Flickr photos by group with location name - flickr

I am grabbing photos from my 2 flickr groups using the API method flickr.groups.pools.getPhotos. This is ok but i'd like to actually return the town name rather than just the geo location. Does anybody know of an alternative method to grab my images including the geo location, town name, and the group that they are in? I'd rather not make multiple API calls per image.
Thanks

So it appears there is no way of doing this. I had to call flickr.groups.pools.getPhotos then flickr.photos.geo.getLocation on each image to get its location. Not the best solution but it is then being cached into a db for improved performance, then only called once every 30 mins.

You can get location attributes by adding "geo" parameter to extras argument for flickr.groups.pools.getPhotos request.
extras (Optional)
A comma-delimited list of extra information to fetch for each returned record. Currently supported fields are: description, license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_q, url_m, url_n, url_z, url_c, url_l, url_o
In response you will receive geo latitude and longitude for each photo from group.

Related

Instagram API - FACEBOOK_PLACES_ID

I wrote a mini instagram wordpress plugin for my cafe's website that shows the photos taken there on our homepage. You can see it in action here: dem-istanbul.com
However, since instagram now uses facebook places instead of foursquare, the location id I'm using is outdated, plus I want to add a second place as we have opened a new branch. I've been using this code to list the photos:
$result = fetchData("https://api.instagram.com/v1/locations/83910054/media/recent/?access_token={$accessToken}&count=8");
However, when I want to add a second location, I am unable to find the location-id as it now fetches data from facebook places. This value had newly been added to the Instagram API, however I'm at a loss on using it:
https://api.instagram.com/v1/locations/search?lat=48.858844&lng=2.294351&access_token=ACCESS-TOKEN
Search for a location by geographic coordinate.
PARAMETERS:
DISTANCE Default is 1000m (distance=1000), max distance is 5000.
FACEBOOK_PLACES_ID Returns a location mapped off of a Facebook places id. If used, a Foursquare id and lat, lng are not required.
FOURSQUARE_ID Returns a location mapped off of a foursquare v1 api location id. If used, you are not required to use lat and lng. Note that this method is deprecated; you should use the new foursquare IDs with V2 of their API.
LAT Latitude of the center search coordinate. If used, lng is required.
LNG Longitude of the center search coordinate. If used, lat is required.
FOURSQUARE_V2_ID Returns a location mapped off of a foursquare v2 api location id. If used, you are not required to use lat and lng.
From what I understand, I should now be able to use facebook places id to list images, but I'm not sure where to get it.
Sorry if that sounds complicated, but I'll be very happy if anyone can help me with this. Thanks very much in advance.
You can find your location facebook place id, foursquare id or by geographic coordinate.
Your second cafe is probably dem bebek. You can get it's () id via http://graph.facebook.com/DemBebek .
By the way you can get your second cafe's medias via https://api.instagram.com/v1/locations/385502821/media/recent

is it possible to return all photos (in all sets) organized by set?

I've got a public flickr with multiple sets.
What I want to do is, with one API call, get all photos from all the sets but have each photo tagged by set.. is this possible?
I can only seem to find API calls that will get all photos for 1 set (flickr.photosets.getPhotos), or all photos in all sets (flickr.people.getPhotos) but can't seem to find one that will get all photos in all sets but somehow tag/id what set each photo belongs to...
possible?
thanks!
You may do the following:
1.get the list of sets for specific user by using
flickr.photosets.getList
2.loop through all sets that the user has and get photos using
flickr.photosets.getPhotos
3.Using
flickr.photos.addTags
to add tags to all the photos in this set

Sphinx "reverse" search

We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.

Instagram: Get photos from a tag after a specified photo

I'm working on an instagram scraper for something and I'm trying to figure out if it's possible to get all photos for a tag that have an id or timestamp later than the last one I have.
The instagram API docs are useless in that they don't have any real info on pagination (which I presume I'll have to abuse).
Does anyone have any ideas?
I've been slogging through the Instagram API for the last couple of days so here's my 2 cents worth:
As far as I can see it if you call the api with /tags/tag-name/media/recent it only return a list if items. If the amount exceeds about 25 you have to make another request with the pagination value returned in the previous request.
In order to gain some control I am initially iterating through all images and storing the results (just the URL not the actual image) to a database. Now I can manipulate however I want. When I feel like updating (I'm doing it manually now but could be a cron job or use the real-time api) I re-read all the images, compare to what I have in my DB and add possible new images. My app then reads out the url and info from my DB (which btw is a heck of a lot faster than going through the instagram api, which will only return about 25 images per request - regardless of any 'count' parameter value you put in the request url) and displays it.
I am developing this for a client who is afraid of people posting nsfw or whatever pics using their dedicated hashtag (for a contest) - with the above set up I can offer them an interface where they can check and mark images that are then displayed in the app.
One thing to watch out for is when a user deletes his picture; you will have to find a way to check for this. Currently (since I'm lazy) I load all images and use jquery to check for an error loading the image. If there is one I delete the image from the DB (via ajax).
I'm not sure the pagination is going to help you: as far as I can see the pagination response has no relation to the id's of the actual image objects on each page - so theoretically a pagination id that jumps to a certain page (i.e. date) might not work tomorrow if enough images have been deleted in the mean time.
to get all images instead of latest 20, just append &count=-1 to your api call - it's that simple.
In either case, there is a timestamp on each json object - or if you prefer, you can use max_tag_id
check out my post here: there any way to show more than 20 photos of the instagram API?
* Update April 2014: count=-1 is no longer available.

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

Resources