Skip to Content
Content Syndication with RSS
book

Content Syndication with RSS

by Ben Hammersley
March 2003
Intermediate to advanced
224 pages
6h 27m
English
O'Reilly Media, Inc.
Content preview from Content Syndication with RSS

LinkpimpClient.pl

LinkpimpClient.pl deals with the majority of the tasks needed for this system. Although feeds can be PubSub-enabled via XML-RPC, SOAP, HTTP POST, or not at all, and while for completeness we should be able to deal with all of these situations to make a Publish and Subscribe system fully spec-compliant, XML-RPC is the only system being used at the moment and the only one we will discuss here.

So, onward! Example 12-1 shows the entire program listing, but first let’s step through the interesting bits to illustrate a few points.

After setting up the necessary variables and loading the modules, we get to the section of the program that deals with the current subscriptions. When the program is run for the first time, this section is irrelevant, but since we’ll probably run this script every hour from cron, it soon becomes necessary. Subscriptions last for 25 hours, so we need to make sure they are renewed in time.

logger ("\n Program started. Let's go!\n"); # First we need to strim the PubSub records and remove all the old entries. # Work out the time 25 hours ago (1 hour = 3600 seconds, so 25 hours = 90000 seconds) my $oldestpossibletime = time( ) - 90000; logger ("The oldest allowable subscription cannot have been made earlier than $oldestpossibletime"); # Open the subscriber list created by pubSubListener and stick it in an array. open (PUBSUBLIST, "<$pubsublog"); my @lines = <PUBSUBLIST>; close (PUBSUBLIST); # Clear the subscriber list. unlink ($pubsublog) or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

How to Build an RSS 2.0 Feed

How to Build an RSS 2.0 Feed

Mark Woodman
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Secrets of RSS

Secrets of RSS

Steven Holzner

Publisher Resources

ISBN: 0596003838Catalog PageErrata