Question

Is is impossible to hotlink images from flickr? I get some random public images and try to put them on my website, but it gives just "image unavailable"

$.ajax({
    url: 'http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key='+key+'&tags=Netherlands&per_page=4&format=json&nojsoncallback=1',
    type: "GET",
    dataType: "json",
    success: function (data) {
        console.log("flickr");
        var flickr = data;
        console.log(flickr.photos.photo);
        for(var j=0; j< flickr.photos.photo.length; j++) {
            $('body').append("<img src=http://farm" 
                            + flickr.photos.photo[j].farm 
                            + ".static.flickr.com/"
                            + flickr.photos.photo[j].server 
                            + "/"
                            + flickr.photos.photo[j].id
                            + "_" + flickr.photos.photo[j].secret+ ".jpg/>"
            );
        }
    },
});

when directly opening the generated link i can see the picture

Was it helpful?

Solution 2

Ok found it. need to add one extra parameter to the ajax request

extra

which can output image address according to site

OTHER TIPS

when you open the link , the site will generate you a direct link at the moment , but you can't see the direct link. i mean if you want to put a picture in your own site , you have to have a direct link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top