O'Reilly logo

Web Site Measurement Hacks by Eric T. Peterson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #36. Build Your Own RSS Tracking Application: The Core Code and Reporting

Syndicating content via RSS is similar to, but not the same as, building normal web pages. Because of this, the parsing of information collected is very similar to our "build your own" web measurement application, using a similar architecture. However, because RSS is designed to be presented in any number of applications and environments, the reporting is slightly different (but no less interesting).

Assuming you've already read how to collect data from within RSS feeds [Hack #12] , you should have an RSS logfile. To learn anything meaningful from RSS.log, you need to parse the file and generate human-readable reports.

The reporting code is broken into five packages and driven by a single script called from the command line (rss_report.pl). The packages are:

RSS_Article.pm

Holds the RSS_Event objects and provides methods for accessing events by type from the RSS_Request object

RSS_Articles.pm

Holds articles by name from the RSS_Request and RSS_Data objects and provides methods for accessing information about the article

RSS_Data.pm

Creates the summary data object and provides methods for processing and reporting

RSS_Event.pm

Provides methods for accessing the RSS_Request objects for the event

RSS_Request.pm

Parses the incoming log line to create an object containing data broken down by field name

Be sure to save each .pm file in your Perl /lib directory.

RSS_Article.pm.

The RSS_Article object is a container for the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required