Cheap Mobile RSS Reader

If you're cheap and have a low-end, generic MP3 player that will also display text files, you can read your RSS feeds on it with the help of this script. It's called rss2txt.pl, and I think it was on the web. I don't know. I may have written it and forgotten about it. Anyway, it was found on my computer.

#! /usr/bin/perl

use XML::RSS;
use WWW::Curl::Easy;

my $curl = WWW::Curl::Easy->new();
$curl->setopt(CURLOPT_HEADER,0);
open DEVNULL,">/dev/null";
$curl->setopt(CURLOPT_WRITEHEADER, DEVNULL );
$curl->setopt(CURLOPT_URL, $ARGV[0] );
my $response_body;
open (my $fileb, ">", \$response_body);
$curl->setopt(CURLOPT_WRITEDATA,$fileb);
my $retcode = $curl->perform;

my $rss = new XML::RSS;
$rss->parse($response_body);

foreach my $item (@{$rss->{'items'}}) 
{
	print $item->{'title'}."\n\n";
	print $item->{'description'}."\n\n";
}

close DEVNULL;

Here's a script that uses it to load up a bunch of text files RSS feeds into my somewhat cheap Sly Electronics mp3 player/camera/videocamera.

#! /bin/bash 
RSS='/home/johnk/bin/rss2txt.pl'
PATH='/media/disk/EBOOK'
$RSS http://krugman.blogs.nytimes.com/feed/ > $PATH/krug.txt
$RSS http://laeastside.com/feed/rss/ > $PATH/eastside.txt
$RSS http://feeds.killeraces.com/wisebread > $PATH/wiseb.txt
$RSS http://diyscholar.wordpress.com/feed/ > $PATH/scholar.txt
$RSS http://feeds.feedburner.com/havemacwillblog > $PATH/bloor.txt
$RSS http://www.fsdaily.com/feed/published/All > $PATH/fsdaily.txt
$RSS http://la.indymedia.org/newswire.rss > $PATH/imcnews.txt
$RSS http://feedproxy.google.com/TechCrunch > $PATH/techcrunch.txt
$RSS http://feedproxy.google.com/DrHousingBubble-HowILearnedToLoveSocal > $P
ATH/drhousing.txt
$RSS http://tirania.org/blog/miguel.rss2 > $PATH/deicaza.txt
$RSS http://seekingalpha.com/feed.xml > $PATH/salpha.txt
$RSS http://feeds.feedburner.com/zephoria/thoughts > $PATH/danaboyd.txt
sync
sync
sync

When the player is plugged in, I type bin/updaterss and, a minute later, my feeds are on the player.