Basically, I am trying to load one random flickr image, taken from a specific user and a specific set, which is then displayed in a div with the id 'flickr-wrap'. I am trying to manipulate this JSON code to do what I want, but don't know where to start. This code is currently being loaded with a lot of images (I just want to download them) and uses tags (but I want the user and sets instead), can anyone help me?
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",{
id: "51997044@N03",
tagmode: "any",
format: "json" },
function(data) {
$("<img/>").attr({src: data.items[0].media.m.replace('_m.','.')}).appendTo("#flickr-wrap");
});
EDIT
I stopped the loop, which is great, and now updated the code above to pull out the set.gne photo instead of public.gne and changed a little how I call the photoset by deleting some lines of code.Now all I need to do is pull out random image from this set. Here, what ive got so far:
$.getJSON("http://api.flickr.com/services/feeds/photoset.gne?set=72157626230243906&nsid=51997044@N03&lang=en-us&format=json&jsoncallback=?",
function(data) {
$("<img/>").attr({src: data.items[0].media.m.replace('_m.','.')}).appendTo("#flickr-wrap");
});
EDIT
There is as yet no random thing to work with. Most annoying. Could really use some help here. Desperate!
source
share