Recent Events for foo.be MainPageDiary (Blog)

HowToBackupFlickr

I have some photos/pictures on the web service flickr and I always wanted to backup my photos including the meta-information generated by such services. I found the excellent CPAN modules called Net::Flickr::Backup for accessing flickr and doing RDF backup of the meta-information.

A basic script to backup everything :

use Net::Flickr::Backup;
use Log::Dispatch::Screen;
    
my $flickr = Net::Flickr::Backup->new("./config.ini");

my $feedback = Log::Dispatch::Screen->new('name'      => 'info',
                                              'min_level' => 'info');

$flickr->log()->add($feedback);
$flickr->backup(); 

With the following config :

[flickr]
api_key = abcdef
api_secret = 13456
auth_token = 123456abcd
api_handler = XPath

[backup]
photos_root = ./photo/
[rdf]
do_dump = 1

and now you have a directory structure including your photo plus the meta-information collected per photos in RDF format:

....
<flickr:comment rdf:about="http://www.flickr.com/photos/adulau/975815967/#comment72157601832281950">
<dc:identifier>3079686-975815967-72157601832281950</dc:identifier>
<dc:created>2007-09-03T13:13:56</dc:created>
<a:body>Je t'offrirai une sacoche, la prochaine fois que je viens aux Bulles...</a:body>
<dc:creator rdf:resource="http://www.flickr.com/people/88977235@N00"/>
<a:annotates rdf:resource="http://www.flickr.com/photos/31797858@N00/975815967"/>
</flickr:comment>
....