in reply to Uses for Perl & XML
Well, I'm using XML::RAI to suck my bookmarks from del.icio.us and store them in a local database. I then have a script to build a list of the most recent 5 bookmarks on my homepage whenever I regenerate the site.
#!/usr/bin/perl use strict; use warnings; use XML::RAI; use LWP::Simple; use SBuilder::DB::Bookmarks; /* This is base Class::DBI */ my $xml = get('http://del.icio.us/rss/dorward'); my $rai = XML::RAI->parse($xml); foreach my $item ( @{$rai->items} ) { my $title = $item->title; my $link = $item->link; my $isodate = $item->issued; my $description = $item->description || ''; my $db = SBuilder::DB::Bookmarks->find_or_create({link => $link}); $db->title($title); $db->date($isodate); $db->description($description); $db->update; }
|
|---|