Recently have been trying out the API available at http://www.flickr.com/services/api. To do this, I have been searching and testing all the available Flickr API wrappers available out there in AS3 and PHP.
The AS3 version is well documented and works as well as an API in flash can. What I needed was a good PHP library, and I found one called Phlickr.
It is maintained by Andrew Morton, as well as a host of contributors. It is written for PHP 5, and works like the dream I was hoping for, so kudos to Andrew!
My only criticism is in the documentation, samples, and tools that are located on the Phlickr site.
I understand that what goes into writing something like this so I am not putting it down for this, I’m not putting it down at all! What I am doing is posting a revised Authentication Token script of my own to use in place of Andrew’s provided one.
His script is simple and straight forward and meant to be ran from command-line, which is what he was going for. I wanted a little more info, because it took me quite some time to find out what running this script actually needed. There is also something wrong, the ‘frob’ sent to the Flickr auth url is not the same ‘frob’ needed to set the auth token, at least not in my experiences.
So… I simply revised what he had, made it more self-contained, and explained extensively step by step from within the command-line.
What you need to run this script is…
- A server running PHP 5
- Some experience using PHP from a command-line interface
- A Flickr account
- A Flickr API Key
- Andrew Morton’s Phlickr PHP 5 Library
Revised Phlickr getToken Script
getToken.php
Thanks again Andrew!
Leave a Reply