SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Nov 2011
    Location
    Down underer
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flicker API: exclude picture with a certain tag?

    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/f...os.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:

    HTML Code:
    <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:

    Code:
    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.

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,651
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Is he tagging the photos travelersautobarn? Or is that just the user?

    PS: In either case, I would probably redact this on my side of the web service unless he stuff so many photos in the stream that you are declining more than you show.

  3. #3
    SitePoint Member
    Join Date
    Nov 2011
    Location
    Down underer
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi and thanks for the reply,

    Both - he has a user with that name, and adds his brandname to the tags and watermarks all the images with his logo - big enough so you even still recognize it on the thumbnails.
    I may have to play around with the tags to find more generic ones.
    Dont think i could exclude the pictures via js on the client side since the number of pictures i get from the api call is quite limited (20?); and eventually i wont find any matching pictures.
    Open for other suggestions ...


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •