{"id":1870,"date":"2007-07-31T09:29:00","date_gmt":"2007-07-31T09:29:00","guid":{"rendered":"http:\/\/www.leobard.net\/blog\/?p=1870"},"modified":"2017-11-04T15:47:38","modified_gmt":"2017-11-04T15:47:38","slug":"flickrbackup-and-rdf","status":"publish","type":"post","link":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/","title":{"rendered":"flickr::backup and RDF"},"content":{"rendered":"<p>Thanks to the CPAN Perl community, you can get all your Flickr pics as RDF-if you have linux, its just a few steps away.<\/p>\n<p>The relevant documentation:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.aaronland.info\/perl\/net\/flickr\/backup\/\">http:\/\/www.aaronland.info\/perl\/net\/flickr\/backup\/<\/a> &#8211; docu of Aaron Straup Cope&#8217;s flickr backup tool<\/li>\n<li><a href=\"http:\/\/www.flickr.com\/services\/api\/auth.howto.web.html\">http:\/\/www.flickr.com\/services\/api\/auth.howto.web.html<\/a> &#8211; how to get a flickr key<\/li>\n<\/ul>\n<p>Perl documentation is excellent. I have seldomly seen such a clean<br \/>\ndocumentation as Aarons tool and the other tools used. It is minimal, it is simple, it doesn&#8217;t miss one point.<br \/>\nHe has example RDF output and example documentation, how to tie everything together was easy to find out using <a href=\"http:\/\/www.CPAN.org\">CPAN.org<\/a>.<\/p>\n<p><b>You will need a <\/b><a href=\"http:\/\/www.flickr.com\/services\/api\/auth.howto.web.html\">flickr API key<\/a> and secret. <br \/>\nAt this point, you need also the <b>auth_token<\/b> of the key, this is trickier to do.<br \/>\nI moved sidewards to get the token, as <a href=\"http:\/\/leobard.twoday.net\/stories\/3390872\/\">I coded with flickr before<\/a>, <br \/>\nI had a PHP application running that I used to get the auth_token.<br \/>\nThe php-flickr API was <a href=\"http:\/\/phpflickr.com\/\">Dan Coulter&#8217;s phpFlickr Class<\/a> 2.1.0,<br \/>\nand it has this getToken.php file that you can tweak to do the right thing.<br \/>\nI am sure you can get the same with Perl. Once you got the key, secret, and auth_token, install the libs:<\/p>\n<p><b>get Perl<\/b> (well, a typical linux distro depends heavily on Perl, so you probably have it already).<\/p>\n<p><b>get the CPAN module for Net::Flickr::Backup<\/b>, I used the perl cpan shell for this (sudo is needed because it installs the perl modules in the shared libs):<\/p>\n<div class=\"code\">\n&gt; sudo perl -MCPAN -e shell\n<\/div>\n<p>in the perl shell, install the backup module:<\/p>\n<div class=\"code\">\n&gt; install Net::Flickr::Backup\n<\/div>\n<p>Now, it asks you many questions. In my case, pressing return most of the time did a good job.<\/p>\n<p>Once you have it installed (perl will say if it doesn&#8217;t), you can run the Backup by writing a script.<\/p>\n<p>I created two files, one for the config, one for the perl that runs:<\/p>\n<p><b>flickrbackup.config<\/b>: (note: the aaaaaa are used to hide my secret keys)<\/p>\n<div class=\"code\">\n[flickr] <br \/>\napi_key=1025521456c3212a4f84032049cee7a1<br \/>\napi_secret=aaaaaaaaaaaaaaaa<br \/>\nauth_token=aaaaaa-aaaaaaaaaaaaaa<br \/>\napi_handler=LibXML<\/p>\n<p>#[search]<br \/>\n#tags=cameraphone<br \/>\n#per_page=500<\/p>\n<p>[backup]<br \/>\nphotos_root=\/home\/media\/photos\/flickrbackup<br \/>\nscrub_backups=1<br \/>\nfetch_medium=0<br \/>\nfetch_square=0<br \/>\nforce=0<\/p>\n<p>[rdf]<br \/>\ndo_dump=1<br \/>\n#rdfdump_root=\/home\/asc\/photos\n<\/div>\n<p>\n<b>runbackup.pl:<\/b><\/p>\n<div class=\"code\">\nuse Net::Flickr::Backup;<br \/>\nuse Log::Dispatch::Screen;<br \/>\nuse Config::Simple;<\/p>\n<p>my $cfg = new Config::Simple(filename=&gt;&#8221;flickrbackup.config&#8221;);<\/p>\n<p>my $flickr = Net::Flickr::Backup-&gt;new($cfg);<\/p>\n<p>my $feedback = Log::Dispatch::Screen-&gt;new(&#8216;name&#8217;      =&gt; &#8216;info&#8217;,                                          <br \/>\n&#8216;min_level&#8217; =&gt; &#8216;info&#8217;);<\/p>\n<p>$flickr-&gt;log()-&gt;add($feedback);<br \/>\n$flickr-&gt;backup(); \n<\/div>\n<p><\/p>\n<p>Now run the scripts:<\/p>\n<div class=\"code\">\n&gt;perl runbackup.pl\n<\/div>\n<p><\/p>\n<p>Lean back and watch the photos + RDF manifest in your filesystem magically. In this case, RDF as a file format is helpful becaue it allowed Aaron to mix different aspects of the metadata.<\/p>\n<p>You may get an error because some XML library misses, my error message contained<br \/>\n&#8220;Can&#8217;t locate XML\/LibXML.pm in @INC&#8221;<br \/>\nLuckily, <a href=\"http:\/\/www.geniustrader.org\/lists\/system-traders\/msg00009.html\">this mailinglist post<\/a> tells you what to do:<\/p>\n<div class=\"code\">\n&gt;sudo apt-get install libxml-libxml-perl\n<\/div>\n<p>This may fail with some weird message, I ignored this and run my backup script again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to the CPAN Perl community, you can get all your Flickr pics as RDF-if you have linux, its just a few steps away. The relevant documentation: http:\/\/www.aaronland.info\/perl\/net\/flickr\/backup\/ &#8211; docu of Aaron Straup Cope&#8217;s flickr backup tool http:\/\/www.flickr.com\/services\/api\/auth.howto.web.html &#8211; how to get a flickr key Perl documentation is excellent. I have seldomly seen such a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;flickr::backup and RDF&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bluesky_dont_syndicate":"","_bluesky_syndication_accounts":"","_bluesky_syndication_text":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-1870","post","type-post","status-publish","format-standard","hentry","category-semweb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>flickr::backup and RDF - Leobard&#039;s blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"flickr::backup and RDF - Leobard&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Thanks to the CPAN Perl community, you can get all your Flickr pics as RDF-if you have linux, its just a few steps away. The relevant documentation: http:\/\/www.aaronland.info\/perl\/net\/flickr\/backup\/ &#8211; docu of Aaron Straup Cope&#8217;s flickr backup tool http:\/\/www.flickr.com\/services\/api\/auth.howto.web.html &#8211; how to get a flickr key Perl documentation is excellent. I have seldomly seen such a &hellip; Continue reading &quot;flickr::backup and RDF&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/\" \/>\n<meta property=\"og:site_name\" content=\"Leobard&#039;s blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/leobard\" \/>\n<meta property=\"article:published_time\" content=\"2007-07-31T09:29:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-11-04T15:47:38+00:00\" \/>\n<meta name=\"author\" content=\"leobard\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"leobard\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/\"},\"author\":{\"name\":\"leobard\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#\\\/schema\\\/person\\\/23f718c5d3bd8d343befaa1b11bdc609\"},\"headline\":\"flickr::backup and RDF\",\"datePublished\":\"2007-07-31T09:29:00+00:00\",\"dateModified\":\"2017-11-04T15:47:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/\"},\"wordCount\":541,\"commentCount\":0,\"articleSection\":[\"SemWeb\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/\",\"url\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/\",\"name\":\"flickr::backup and RDF - Leobard&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#website\"},\"datePublished\":\"2007-07-31T09:29:00+00:00\",\"dateModified\":\"2017-11-04T15:47:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#\\\/schema\\\/person\\\/23f718c5d3bd8d343befaa1b11bdc609\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2007\\\/07\\\/31\\\/flickrbackup-and-rdf\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"flickr::backup and RDF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/\",\"name\":\"Leobard&#039;s blog\",\"description\":\"personal weblog of Leo Sauermann\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#\\\/schema\\\/person\\\/23f718c5d3bd8d343befaa1b11bdc609\",\"name\":\"leobard\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g\",\"caption\":\"leobard\"},\"description\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/about-leo-sauermann\\\/\",\"sameAs\":[\"https:\\\/\\\/www.leobard.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/leobard\",\"https:\\\/\\\/www.instagram.com\\\/leobarder\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/leosauermann\\\/\"],\"url\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/author\\\/leobard\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"flickr::backup and RDF - Leobard&#039;s blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/","og_locale":"en_US","og_type":"article","og_title":"flickr::backup and RDF - Leobard&#039;s blog","og_description":"Thanks to the CPAN Perl community, you can get all your Flickr pics as RDF-if you have linux, its just a few steps away. The relevant documentation: http:\/\/www.aaronland.info\/perl\/net\/flickr\/backup\/ &#8211; docu of Aaron Straup Cope&#8217;s flickr backup tool http:\/\/www.flickr.com\/services\/api\/auth.howto.web.html &#8211; how to get a flickr key Perl documentation is excellent. I have seldomly seen such a &hellip; Continue reading \"flickr::backup and RDF\"","og_url":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/","og_site_name":"Leobard&#039;s blog","article_author":"https:\/\/www.facebook.com\/leobard","article_published_time":"2007-07-31T09:29:00+00:00","article_modified_time":"2017-11-04T15:47:38+00:00","author":"leobard","twitter_card":"summary_large_image","twitter_misc":{"Written by":"leobard","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/#article","isPartOf":{"@id":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/"},"author":{"name":"leobard","@id":"https:\/\/www.leobard.net\/blog\/#\/schema\/person\/23f718c5d3bd8d343befaa1b11bdc609"},"headline":"flickr::backup and RDF","datePublished":"2007-07-31T09:29:00+00:00","dateModified":"2017-11-04T15:47:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/"},"wordCount":541,"commentCount":0,"articleSection":["SemWeb"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/","url":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/","name":"flickr::backup and RDF - Leobard&#039;s blog","isPartOf":{"@id":"https:\/\/www.leobard.net\/blog\/#website"},"datePublished":"2007-07-31T09:29:00+00:00","dateModified":"2017-11-04T15:47:38+00:00","author":{"@id":"https:\/\/www.leobard.net\/blog\/#\/schema\/person\/23f718c5d3bd8d343befaa1b11bdc609"},"breadcrumb":{"@id":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.leobard.net\/blog\/2007\/07\/31\/flickrbackup-and-rdf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.leobard.net\/blog\/"},{"@type":"ListItem","position":2,"name":"flickr::backup and RDF"}]},{"@type":"WebSite","@id":"https:\/\/www.leobard.net\/blog\/#website","url":"https:\/\/www.leobard.net\/blog\/","name":"Leobard&#039;s blog","description":"personal weblog of Leo Sauermann","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.leobard.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.leobard.net\/blog\/#\/schema\/person\/23f718c5d3bd8d343befaa1b11bdc609","name":"leobard","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g","caption":"leobard"},"description":"https:\/\/www.leobard.net\/blog\/about-leo-sauermann\/","sameAs":["https:\/\/www.leobard.net\/","https:\/\/www.facebook.com\/leobard","https:\/\/www.instagram.com\/leobarder\/","https:\/\/www.linkedin.com\/in\/leosauermann\/"],"url":"https:\/\/www.leobard.net\/blog\/author\/leobard\/"}]}},"_links":{"self":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts\/1870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/comments?post=1870"}],"version-history":[{"count":1,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts\/1870\/revisions"}],"predecessor-version":[{"id":2656,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts\/1870\/revisions\/2656"}],"wp:attachment":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/media?parent=1870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/categories?post=1870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/tags?post=1870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}