Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Pulling only one photo into a webpage from Flickr

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27227
    runboston
    Member

    Hello, this might not be the forum for this question, but I’ve had great luck getting my questions answered here in the past, so I thought I would ask.

    I know it’s possible to pull an entire Flickr feed into a web site, but I haven’t been able to find anything regarding pulling only one image and the associated title and description. So, basically I just want to have a simple, clean page that displays the title, image, and description of one photo from my Flickr feed. Is this possible and if so, does anyone have an example of it?

    Thanks for your time.
    Jon

    #68242
    BaylorRae
    Member

    I’m assuming you want to use javascript and in more detail jQuery.

    I grabbed this code from the snippets area and I think it’s want you want

    Code:
    $(document).ready(function() {

    var toLoad = 1;
    $.getJSON(“http://api.flickr.com/services/feeds/photos_public.gne?id=35591378@N03&format=json&jsoncallback=?”, function(data) {
    var target = “#latest-flickr-images ul”; // Where is it going?
    for (i = 0; i <= (toLoad - 1); i = i + 1) { // Loop through the 10 most recent, [0-9] var pic = data.items[i]; var liNumber = i + 1; // Add class to each LI (1-10) $(target).append("

  • “);
    }
    });
    });

Viewing 2 posts - 1 through 2 (of 2 total)