Im playing around with this piece of code from http://api.jquery.com/jQuery.getJSON/ (see code example further down, pictures with the cats). What i want to do is specify multiple tags, but exclude a certain tag. At http://www.flickr.com/services/api/flickr.photos.search.html the flickr docu states:
tags (Optional)
A comma-delimited list of tags. Photos with one or more of the tags listed will be returned. You can exclude results that match a term by prepending it with a - character.
However this doesn’t work for me:
<script>
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
{
tags: "sydney,cairns,roadtrip,-travellersautobarn",
format: "json"
},
function(data) {
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m)
.attr("alt", item.title).attr("title", item.title).appendTo("#images");
});
});
</script>
Firebug shows that my API call looks like the following to exclude a certain car dealer who keeps … erm… “promoting” within those tourist destinations:
http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=jsonp1322818492147&_=1322818492160&tags=sydney%2Ccairns%2C-travellersautobarn&format=json
but i still get his pictures in the response (see items -> tags ). Has anyone a solution for this, or can tell me what i’m doing wrong here? If i could exclude this guy via user_id this would probably also solve the issue for me.