_dodger opened this issue on Dec 04, 2002 ยท 6 posts
_dodger posted Wed, 04 December 2002 at 12:42 PM
First, I really think a rant forum is in order. I feel a need for a place to bitch about how a perfectly good work can be passed over by so many dolts when the thumbnail doesn't show any chicks or ninjas. Aside from that, I have a gallery suggestion and a Free Stuff suggestion. Really, the same suggestion. We have a 'best rated' and 'most comments' but not a 'hot' search order. The Hot 20 doesn't count nor does it work. Something that takes into account a date -- for instance, best rated for the last day, week, month, etc. Most commented restricted by the same. Maybe even a dropdown for time period and text box for number of that time period. For the Free Stuff, it would be in terms of downloads. Okay, another suggestion... a pretty simple one, actually... this one is titally Free Stuff related -- Add a column to the Free Stuff table that marks whether something is active or not. As simple as active enum('Y','N'). Or even dead char(0) (null is not dead, '' is dead). Now, once per night, run something like the folowing ina cron job:
#!/usr/bin/perl
use DBI;
use LWP::Simple(':all');
my $dbh = DBI->connect('DBI:mysql:freestuff','freestuffuser','freestuffpass');
my $get_free_stuff = $dbh->prepare(<<"eosql");
SELECT url, id
FROM free_stuff
eosql
my $setactive_fs = $dbh->prepare(<<"eosql");
UPDATE free_stuff
SET active = ?
WHERE id = ?
eosql
$get_free_stuff->execute;
while (my ($url, $id) = $get_free_stuff->fetchrow_array) {
if (Get($url)) {
$setactive_fs->execute('Y',$id);
}
else {
$setactive_fs->execute('N',$id);
}
}
This will at least clear out the Free Stuff that leads to a broken link. You can do the same with the image, too, and easily wrap it all into the same script. Just once a night will be plenty to delete all the damned things in Free Stuff that have huge numbes of 'downloads' only because people think it looks cool and check back occassionally to see if maybe, just maybe, the link is fixed.