Print Story Interesting
Scoop
By hulver (Wed Sep 01, 2010 at 07:48:42 AM EST) (all tags)
There is no code in Scoop to expire subscriptions.

Update [2010-9-2 15:18:32 by hulver]: Fixed now thanks to Captain Tenille.



Also the expiry date column is some form of integer field that I'm sure had a great reason to be used at the time, as opposed to say a date field.

That makes writing expiry code slightly more complicated than it needs to be.

There did used to be a scoop box repository somewhere, but I think it died at the same time the old HuSi server did.

scoop.kuro5hin.org goes to a holding page, but a look through on the way back machine doesn't show any updates to the subscription system.

Looks like I'll have to cobble something together when I've got a spare moment.

< It's almost September | It's like Star Wars, as told from the POV of Leia. >
Interesting | 26 comments (26 topical, 0 hidden) | Trackback
(Comment Deleted) by aggressive cyclist (2.00 / 0) #1 Wed Sep 01, 2010 at 08:34:13 AM EST

This comment has been deleted by aggressive cyclist



time_t ? by sasquatchan (2.00 / 0) #2 Wed Sep 01, 2010 at 08:57:26 AM EST
julian ?

(and absolute or differential, or ...)

I'm thinking.. by Driusan (2.00 / 0) #3 Wed Sep 01, 2010 at 09:09:39 AM EST
probably unix time.

I don't have a scoop install anymore and haven't for years, so I can't look into it but that seems the most likely.

--
Vive le Montréal libre.

[ Parent ]
Subscribing to 2038...... by marvin (2.00 / 0) #4 Wed Sep 01, 2010 at 09:31:25 AM EST
Would that be an evil thing to do then?

[ Parent ]
time_t it is.. by sasquatchan (2.00 / 0) #5 Wed Sep 01, 2010 at 09:35:26 AM EST
or epoch, or any of the other 20 names the same thing goes by.. But never underestimate the ability of coders to get clever, thus julian is a possibility..

[ Parent ]
.... or worse .... by gpig (2.00 / 0) #6 Wed Sep 01, 2010 at 11:48:27 AM EST
I've seen code with date-as-integer made up YYYYMMDD, e.g. 20090130. Classy.
---
(,   ,') -- eep
[ Parent ]
Does the expiration really matter? by muchagecko (2.00 / 0) #7 Wed Sep 01, 2010 at 12:27:32 PM EST
As it is, the negative subscription date works as an ugly reminder that I need to get a job so I can resubscribe.


A purpose gives you a reason to wake up every morning.
So a purpose is like a box of powdered donut holes?
Exactly
My Name is Earl

Well by hulver (4.00 / 1) #8 Wed Sep 01, 2010 at 12:42:04 PM EST
You're still a subscriber, even though you're in negative subscription days.

If the subscription doesn't expire, you'll retain the impressive list of perks that being a subscriber gives you. ;)
--
Cheese is not a hat. - clock

[ Parent ]
I didn't realize that. by muchagecko (2.00 / 0) #12 Wed Sep 01, 2010 at 03:01:22 PM EST
The negative subscription is enough for me to pay as soon as I can.


A purpose gives you a reason to wake up every morning.
So a purpose is like a box of powdered donut holes?
Exactly
My Name is Earl

[ Parent ]
There's supposed to be a cron that does it. by Captain Tenille (2.00 / 0) #9 Wed Sep 01, 2010 at 01:37:45 PM EST
 Should be a box called something like 'expire_subs', but if there isn't, this is what I have:

# Get list of subscribers
my ($rv, $sth) = $S->db_select({
    WHAT => 'uid',
    FROM => 'subscription_info',
    WHERE => 'UNIX_TIMESTAMP(NOW()) > expires AND active = 1' });
my @users;
while (my $r = $sth->fetchrow()) {
    push @users, $r;
    }
$sth->finish();
# Deactivate subscriptions
($rv, $sth) = $S->db_update({
    WHAT => 'subscription_info',
    SET => qq{active = 0, last_updated = NOW(), updated_by = 'system'},
    WHERE => 'UNIX_TIMESTAMP(NOW()) > expires AND active = 1' });
$sth->finish();
# Change users group back
#my $gid = $S->_get_default_group();
my $gid = 'Users';
my $where = 'uid = ' . join(' OR uid = ', @users);
($rv, $sth) = $S->db_update({
    WHAT => 'users',
    SET => qq{perm_group = '$gid'},
    WHERE => $where });
$sth->finish();


---------

/* You are not expected to understand this. */


Thanks by hulver (2.00 / 0) #10 Wed Sep 01, 2010 at 02:00:27 PM EST
No, not got that one.
--
Cheese is not a hat. - clock
[ Parent ]
scoop.kuro5hin.org goes to a holding page by wiredog (2.00 / 0) #11 Wed Sep 01, 2010 at 02:23:32 PM EST
I noticed that last year. Saw the subscription issue last week.

I assume you have a copy of the Scoop that this place runs... May be time to put it on sourceforge?

Earth First!
(We can strip mine the rest later.)

It's sort of ok by komet (2.00 / 0) #13 Wed Sep 01, 2010 at 03:41:53 PM EST
I always get a terrible conscience when it says I have -121 days left. It's like computerised passive aggression. Although I do wonder if "renewing" for e.g. another month would put me on -91 days or on +30?

--
<ni> komet: You are functionally illiterate as regards trashy erotica.
I'm fairly sure by hulver (2.00 / 0) #17 Thu Sep 02, 2010 at 02:06:01 AM EST
That renewing now will just knock days off the "time owed".

Once you start, you can never stop.

I'll fix that when I put the change live.
--
Cheese is not a hat. - clock

[ Parent ]
There by hulver (2.00 / 0) #19 Thu Sep 02, 2010 at 10:17:46 AM EST
Hopefully if you renew it will go from the date you renew, rather than the date of expiry.

Not actually tested that though. Yee haw!
--
Cheese is not a hat. - clock

[ Parent ]
TESTING NOW by komet (2.00 / 0) #20 Fri Sep 03, 2010 at 04:55:47 AM EST
(klaxon) (klaxon) TESTING IN PROGRESS

--
<ni> komet: You are functionally illiterate as regards trashy erotica.
[ Parent ]
Hm. by komet (2.00 / 0) #21 Fri Sep 03, 2010 at 05:01:11 AM EST
It only gave me the option of a basic subscription. I want my yellow diamond!

--
<ni> komet: You are functionally illiterate as regards trashy erotica.
[ Parent ]
Odd by hulver (2.00 / 0) #22 Fri Sep 03, 2010 at 05:25:53 AM EST
Gold diamond awarded.

I'll look into why it wouldn't let you pick supa-doopa subscription.
--
Cheese is not a hat. - clock

[ Parent ]
Ah by hulver (2.00 / 0) #23 Fri Sep 03, 2010 at 05:51:11 AM EST
It wasn't set as renewable. It'll work next time.
--
Cheese is not a hat. - clock
[ Parent ]
thanks by komet (2.00 / 0) #24 Fri Sep 03, 2010 at 07:22:56 AM EST
but you should change my gold subscription from currently 124 to 41 days, given the differing price.

--
<ni> komet: You are functionally illiterate as regards trashy erotica.
[ Parent ]
Beta testing reward ;) by hulver (2.00 / 0) #25 Fri Sep 03, 2010 at 07:27:52 AM EST

--
Cheese is not a hat. - clock
[ Parent ]
thank you by komet (2.00 / 0) #26 Fri Sep 03, 2010 at 11:56:17 AM EST


--
<ni> komet: You are functionally illiterate as regards trashy erotica.
[ Parent ]
You mean Rusty failed to finish something? by fluffy (4.00 / 3) #14 Wed Sep 01, 2010 at 04:04:36 PM EST
 I DON'T BELIEVE IT
busy bees buzz | sockpuppet revolution
oh he finished it. by dev trash (2.00 / 0) #16 Wed Sep 01, 2010 at 06:29:34 PM EST
He just forgot to sync his git with the cvs.

--
Click
[ Parent ]
unix timestamp perhaps? by dev trash (2.00 / 0) #15 Wed Sep 01, 2010 at 06:29:03 PM EST


--
Click
Indeed it is. by hulver (2.00 / 0) #18 Thu Sep 02, 2010 at 04:51:20 AM EST

--
Cheese is not a hat. - clock
[ Parent ]
Interesting | 26 comments (26 topical, 0 hidden) | Trackback