Some time ago, I used a handy Perl script called fp2flickr to import some Fotopic collections into Flickr. It was crude but it did the job usefully. After a moderate amount of hacking and bodging, I’ve now modified it to import PhotoPost albums into Flickr: pp2flickr.
The level of support for this script is nil. If you’ve come here looking to blame or complain, please refrain because I’m not interested. If it deletes all your images and then uploads pictures of your genitals and emails the link to your mother, I take no responsibility except to say that was not my intention. By all means fix or modify it further and redistribute, with or without my credit.
pp2flickr is heavily based on fp2flickr by John Hartnup, which in turn was heavily based on flickr_upload by Christophe Beauregard: both of these fine gentlemen did most of the work. I can’t speak for their code, but the stuff I’ve added is pretty ropey; this is purely intended for one-shot conversions. I’ve used it to upload several albums, including one private album of 172 images over 15 pages, and it worked fine but YMMV. Note well that it was designed and coded to handle PhotographyBlog galleries and is heavily dependent on the HTML formatting of that particular site. It will probably break on other PhotoPost sites as there seems to be little standardisation across them. (For example, it won’t work with Nikonians galleries, although it probably wouldn’t be too much hassle to adapt it once you understand the URL formats.)
The changes as far as I recall were:
- Comment the code to aid my own comprehension, and add (commented) debugging output.
- Add a cookie jar to the user agent, to handle PP password-protected albums.
- Completely hack the page parsing to handle PP/PBlog albums. While Fotopic appears fairly basic, it actually uses well-designed HTML wherein the various page elements are clearly differentiated at the CSS level. In contrast, elements in PP can only effectively be identified by the form of their URLs. In particular, pp2flickr makes some crude assumptions about what lies where, such as when matching titles to thumbnails. Note that on PB, long titles will be ellided on the thumbnails page and this form will be carried over to Flickr. Also, pp2flickr can only handle URLs for individual albums, not a page of many albums (although there are comments in the code that indicate how this could be easily done - left as an exercise for someone else).
- Carry over titles and descriptions from PP (NB. beware the variable naming in the code, it is unchanged from fp2flickr and usually inaccurate), plus convert keywords to tags.
- Add a little more output while working.
- Update the POD documentation: you must read this.
To use pp2flickr, you will need to register an API key for your account and follow the instructions in the POD for generating an authentication token; I suggest you put all these details in your
.flickrrc file. If you’re still unsure how to run it, you probably shouldn’t be running it unless you understand how to use Perl on your platform.