Skip to Content
Developing Feeds with RSS and Atom
book

Developing Feeds with RSS and Atom

by Ben Hammersley
April 2005
Intermediate 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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Content Syndication with RSS

Content Syndication with RSS

Ben Hammersley
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0596008813Errata Page