Skip to content

Instantly share code, notes, and snippets.

@mattn
Created April 7, 2009 04:52
Show Gist options
  • Select an option

  • Save mattn/91104 to your computer and use it in GitHub Desktop.

Select an option

Save mattn/91104 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use lib qw/lib/;
use URI;
use XML::Feed;
use XML::Feed::Deduper;
binmode STDOUT, ":encoding(cp932)" if $^O eq "MSWin32";
my $deduper = XML::Feed::Deduper->new(
path => '/tmp/feed.dat'
);
while (1) {
my $feed = XML::Feed->parse( URI->new('http://twitter.com/statuses/user_timeline/5209741.rss') );
for my $entry ($deduper->dedup($feed->entries)) {
print "new entry:",$entry->title,"\n";
}
sleep 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment