Skip to Main Content
Developing Feeds with RSS and Atom
book

Developing Feeds with RSS and Atom

by Ben Hammersley
April 2005
Intermediate to advanced content levelIntermediate to advanced
270 pages
7h 13m
English
O'Reilly Media, Inc.
Content preview from Developing Feeds with RSS and Atom

Last-Modified Files

There are lots of reasons to have an ever-updating list of recently modified files: security, for one. However, it’s also a useful system for helping you group working files in your mind. I’m forever loosing track of files I’m working on—especially overnight—and this feed helps a great deal. For collaborative working, it’s a godsend because you can see what other activity is going on automatically. I also have one of these pointed at a shared directory where friends drop music and silly MPEGs. Altogether, for something so simple, it’s remarkably useful.

It’s a CGI script that takes a single parameter path, which should be equal to the absolute path on your filesystem that you wish to look under—for example, http://www.example.org/lastmodified.cgi?path=/users/ben.

Walking Through the Code

Let’s trek once again into the warnings;, strict;, XML::RSS, and CGI, plus Date::Manip for the dateline and File::Find for its directory traversing capabilities. Lovely. All set? Good.

use warnings;
use strict;
use XML::RSS;
use CGI qw(:standard);
use File::Find;
use Date::Manip;

By now you should be getting the hang of this. We’re firing up the CGI module, snaffling the parameter we are passing to it, then setting up the feed. No great mystery here, in other words. Really, this is somewhat the point: feeds are very simple things. It’s the ideas of how to use them that are valuable.

my $cgi = CGI::new( ); my $start_directory = $cgi->param('path'); my $rss = new XML::RSS( version ...
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
Secrets of RSS

Secrets of RSS

Steven Holzner

Publisher Resources

ISBN: 0596008813Supplemental ContentErrata Page