Skip to content


phpFlickr 1.4.3, now with more interestingess

I've just put up version 1.4.3 of phpFlickr for you to download. The guys at Flickr just put out a new method to display the most interesting photos of a day. I've implemented it as interestingness_getList(). If you go to the interestingness example, you can see it in action. One thing to bear in mind is that the first date parameter must be in the YYYY-MM-DD format. I haven't built in any date conversions yet and that's the format that the API is expecting. I may build in some conversions for the next minor release.

Another important note: If you were using favorites_getList() or favorites_getPublicList(), you'll need to adjust your program slightly. Instead of being able to access the $result['photo'] array, you'll need to access $result['photos']['photo'] array. Why did I do this? The "photos" element holds more data than just the photos. You'll need that data to view how many favorites someone has, how many pages there are, etc. The first way I did it was a mistake and I hope that you'll find it in your collective heart to forgive me.

Posted in Uncategorized.

4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. this is great! one note - on the installation instructions page, it's said the pear package necessary is HTTP_Response - should this actually be HTTP_Request?

  2. Yes, that is what I meant. I thought that I had fixed that typo a long time ago. Thanks for pointing it out.

  3. Ugo saidReply to this comment

    Hi Dan.

    First of all, thanks for developing and making phpFlickr available.

    The examples given on phpFlickr home did not work at first. After some debugging I found that the problem was the proxy of the HTTP_Request package of PEAR not being set.
    The simple fix was to add one line to function phpFlickr of phpFlickr.php:

    function phpFlickr ($api_key, $secret = NULL, $die_on_error = true)
    {
    //The API Key must be set before any calls can be made. You can
    //get your own at http://www.flickr.com/services/api/misc.api_keys.html
    $this->api_key = $api_key;
    $this->secret = $secret;
    $this->die_on_error = $die_on_error;

    //All calls to the API are done via the POST method using the PEAR::HTTP_Request package.
    require_once 'HTTP/Request.php';
    $this->req =& new HTTP_Request();
    $this->req->setProxy( your_proxy_here, port_number_here );
    $this->req->setMethod(HTTP_REQUEST_METHOD_POST);

    //setup XML parser using Aaron Colflesh’s XML class.
    $this->xml_parser = new xml(false, true, true);
    }

    I thought you may want to add a note to the readme to point this thing out.

    Regards
    Ugo

Continuing the Discussion

  1. Geeklog - Flickr plugin linked to this post on January 8, 2006

    [...] And that's pretty much everything the plugin currently does.The plugin uses Dan Coulter's phpFlickr class (version 1.4.3 is included with the plugin) which does all of the hard work of communicating with Flickr. It also provides caching options, as the use of [flickr:] autotags may significantly slow down your site otherwise (see the plugin's README for details). [...]

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.