Flickr API - Photos Search, excluding tags: Am I doing this wrong?

Go To StackoverFlow.com

0

So, I'm trying to pull all photos of a specific user's account via the flickr.photos.search method, but I want to exclude photos with a particular tag. The related documentation page states that "You can exclude results that match a term by prepending it with a - character." ... Well, I tried implementing that option but what get in return is only one photo (even though there are several photos with the tag in question) and that result remains the same whether that specific photo has the tag in question or not AND whether or not I use the "-" option to exclude that tag rather than include it. I also tried the text method with the same exact result. Here's my REST call:

http://api.flickr.com/services/rest/?&method=flickr.photos.search&api_key='.$api_key.'&user_id='.$user_id.'&tag_mode=any&tags=-blog&extras=url_o,url_t&format=json

And here is the page where I'm trying to get this all working:

http://corazonbrew.com/temp/

Anyone know what is going on here?

2012-04-04 23:09
by mroncetwice
Well I dunno what the hell is going on, but I just added var_dump() call to show the results array, and suddenly things appear correct .. Well, almost- I now see the photos with the tag in question, but I'm using the "-" option to try to exclude those images, still to no avail.

I have to run out for a few hours right now, but will do some more testing and report back ASAP - mroncetwice 2012-04-05 00:12

OK, I'm back. I removed the var_dump() and I'm thankfully still seeing more than one photo, but the exclusion option is still not working .. any thoughts on the matter - mroncetwice 2012-04-05 03:51
Finally found some other mentions of this issue, but still no fix that works for me:


http://www.flickr.com/groups/api/discuss/72157625456418732/


http://www.sitepoint.com/forums/showthread.php?804847-Flicker-API-exclude-picture-with-a-certain-ta - mroncetwice 2012-04-05 13:55



0

It seems the answer in the Flickr discussion board I linked to earlier is proving true. In order to use the exclusion option, there has to also be at least one other, non-excluded tag. Well, that is just not good enough for me.

A couple of friends tell me this is a longstanding bug that will not be fixed anytime soon, if ever. But those friends also kindly reminded me of my n00bishness- this whole time I thought I needed to affect the feed to get the desired output. I totally was not realizing I could just use some good ol' PHP if statements to weed out what I don't want.

2012-04-05 20:09
by mroncetwice
Ads