Webmastersite.net
Register Log In

feed with expiring links

Comments on feed with expiring links

hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Oct 13, 2008 - 9:32 AM:

Is there a way for links which have expired to be removed from a feed or is that something that would have to be controlled by the site offering the feed?

For example, on the site listed above there is a list of sales from Tiger Direct. If you click on each link it will take you to the page for that sale, but if the sale has expired it will take you to their home page instead and therefore I'd like to just remove that link.

If it's something that would have to be controlled by tiger direct in this example then would there be a way that I can have the link deleted/hidden once the landing page goes to a certain link?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 13, 2008 - 4:31 PM:

By "expired" you're not talking about the WSN expiration feature?

I suppose I could build a new link checker option to find pages that are redirecting, but then you'll not want delete most redirects, and you'll have to run it manually, and it'll take ~5 hours / $250. Adding a per-link option to specify what URL is a "bad redirect" for that link would add another 2 hours.
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Oct 15, 2008 - 8:09 PM:

Yes, you're correct, I didn't mean WSN expiration. But let me ask you this. Is there a way to have links that are being pulled in from a feed to automatically delete after a period of time? So, that any links added to the directory today will expire(delete) 2 weeks from today, but any links added to the directory next week will expire 2 weeks from that date. Is something like what I'm describing feasible?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 17, 2008 - 9:17 AM:

I believe this as a cron or modification file would do it:
<?php $db->delete('linkstable', 'xmlsource > 0 AND time < '. time() - 86400*14); ?>
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Oct 17, 2008 - 9:33 PM:

WARNING - DO NOT RUN THE ABOVE CODE WITHOUT A BACKUP FIRST!

Thanks for trying Paul, but when I ran the above as a cron it deleted all the links in my directory. Thank goodness I had a backup that was a few days old so it wasn't a tragedy, but I want to make sure no one else runs it without making sure they have a backup on hand.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 18, 2008 - 2:07 PM:

If it deleted everything, that means all your links are from feeds and more than 2 weeks old...
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Oct 18, 2008 - 7:16 PM:

Actually, that is not the case. The only links from a feed are the ones in one subcategory although most links may be over 2 weeks old, I don't remember off hand. But my wsn_links table was completely cleaned out after running the cron.

In any case, I'm not pursuing this anymore so don't worry about it, I just wanted to make sure no one happened to come across the code and get burned.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 19, 2008 - 5:43 PM:

Very odd. For no apparent reason, you have to use parentheses:

$db->delete('linkstable', 'xmlsource > 0 AND time < '. (time() - 86400*14));
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.