Adding Flickr photos to Foursquare using YQL
Browsing the updated Foursquare development documents I came across a real nice hidden gem: it appears that the Flickr folks have enabled so called machine tags to associate a photo with a Foursquare venue.
The almost hidden quote from the Flickr Developer blog:
This is the part where I casually mention that we’ve also added machine tags extra love for Four Square venues IDs. I’m just saying…
Now how cool would it be to display a little photo on my Foursquare Layar venue detail pages?
Remembering @codepo8‘s execellent talk at the Fronteers conference last week, I realized that this is where the really cool YQL engine comes in really handy.
And indeed, the following query does it all:
select * from flickr.photos.search where machine_tags="foursquare:venue=132009" limit 1
Just save the REST command url, wrap it in a little PHP handler and we’re good to go (homework for next time: process the YQL response in XML format with js/e4x and skip the PHP part altogether).
So now you will see a little thumbnail picture for every venue which has a photo tagged on Flickr. There aren’t many yet, but hey, it’s a start!
See it in action in the Foursquare Layar app on your phone (iPhone, Android) or read my announcement for more background information about the foursquare layar app.
Somewhat related articles by Zemanta
- Small pieces, loosely joined by machine tags (adactio.com)
- Zee.: Noticings is Foursquare for photo sharers (thenextweb.com)
- Noticings: Geotagging Photo Game Powered by Flickr API (readwriteweb.com)
Popularity: 5%




![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=2871e662-f49d-4c01-9cee-a14969cfba0c)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=c124d219-2297-436d-93ff-fa65a03e5444)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=8c9bbfd2-ffe9-4839-b0dc-d3e622f63df1)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=61ed241c-3cee-4fb0-8186-666c8e1ec536)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=08fcac3f-03b3-4d95-9587-84789d2b71a8)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=e552982d-d819-467a-8980-b3837c527d3b)
Joe 09:45 on June 10, 2009 Permalink |
Update: indeed, the bug has been fixed in Firefox 3.5b99 – but some requests return a very unaccurate estimate, while others are perfect within only a few meters error.
I guess in some cases Wifi is used, while in other cases generic Geo IP tables are used (e.g. if the Wifi lookup times out?).
Doug Turner 03:14 on June 23, 2009 Permalink |
exactly. if a wifi position is found, that is the location that is shared with the website. if no wifi position is found, a location based on IP is shared.
Keep in mind, all of this is optional — we don’t share anything until you click “share location” in the notification bar.
Hope that helps!
Doug Turner
Johan Sundström 04:13 on June 24, 2009 Permalink |
Works fine in the iPhone 3G mobile Safari (OS 3.0) browser, too.
Joe 06:54 on June 24, 2009 Permalink |
Cool, thanks!
It doesn’t work out of the box on Android’s Webkit browser on the G1, need Google’s interface for that apparently.