Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Uses for Perl & XML

by dorward (Curate)
on Jun 07, 2005 at 16:18 UTC ( [id://464365]=note: print w/replies, xml ) Need Help??


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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://464365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found