RSS

Outsourcing blog parts

It seems to be very modern to outsource thse days, and I’m trying to keep up. A while back I switched my RSS feeds from Wordpress Build-in services to FeedBurner. It was a win-win. Has a lot less load and feedburner does a lot of work to make sure the Feeds are in top-notch shape.

Yesterday another little change happended. All the website commenting were outsourced to Disqus. The signup procedure was a breze and they had a nice plugin available for wordpress making the switch a 5 second job. So far it seems to work well and once again the server hosting the website should have a smaller load in the future.

Letting others feed the web for you

I follow a ton of sites on the web. I go for a morning surf through each and every one of them; I use an aggregator which checks the feeds from the websites, and tell me where to go for news. I guess most people do this – using feeds to find updates and then visit the site to check out the content.This way of tracking sites has changed one important thing on this website – the most popular file on the site is no longer the frontpage nor is it at particular popular page with a high Google ranking – it’s the feeds. Until recently almost 25% of all inbound tracking was hits to the main feed-URL.

Parsing RSS feeds

del.icio.us is a neat service for managing an online bookmark collection. With a little bit of Perl and a few CPAN modules, you can fetch your most recent bookmarks and include them as links on your homepage.

The sample script could be used in a cronjob and creates a file on you local server. It downloads my del.icio.us bookmark feed, chops it down to the ten most recent bookmarks and writes a unordered bullet list. You may need to adapt the template to your specific needs.

#!/usr/local/perl/bin/perl
use strict;
use warnings;

use LWP::Simple;
use XML::RSS;
use HTML::Template;

my $file = 'include_links.txt';

my @links;
my $tmpl = HTML::Template->new(filename => 'rssFetch.tmpl');
my $rss = XML::RSS->new();
my $data = get( 'http://del.icio.us/rss/mahler' ); # RSS Source
$rss->parse( $data );

$#{$rss->{'items'}} = 9; # Only the 10 most recent items

foreach my $item ( @{ $rss->{'items'} } ) {
  push @links, +{ description => $item->{'dc'}->{'subject'},
		  url => $item->{'link'},
		  title => $item->{'title'}
  }
};

$tmpl->param( links => @links );
open (FILEWRITE, ">$file");
print FILEWRITE $tmpl->output();
close FILEWRITE;

exit();
With the included modules you can do a lot of other interesting stuff. The XML::RSS module also includes functionality to create feeds and you could quite easily create aggregated feeds and other cool stuff with Perl and RSS-feeds.