<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code: Flickr Developer Blog</title>
	<atom:link href="http://code.flickr.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.flickr.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 19 Nov 2009 15:59:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building authorized Flickr apps for the iPhone</title>
		<link>http://code.flickr.com/blog/2009/11/19/building-authorized-flickr-apps-for-the-iphone/</link>
		<comments>http://code.flickr.com/blog/2009/11/19/building-authorized-flickr-apps-for-the-iphone/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 00:01:32 +0000</pubDate>
		<dc:creator>Jérôme</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1158</guid>
		<description><![CDATA[
You want to develop an iPhone app that interacts with Flickr content? This sounds pretty good. And the Flickr API provides you with an authorization workflow that is particularly adapted for this device.   And Flickr members love their iPhones.
An authorization workflow you say, but why? Let me step back for a moment. First [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/smercury98/2287169356/" title="only by SMercury98, on Flickr"><img src="http://farm3.static.flickr.com/2006/2287169356_7ce2d716c8.jpg" width="500" height="410" alt="only" /></a></p>
<p>You want to develop an iPhone app that interacts with Flickr content? This sounds pretty good. And the <a href="http://flickr.com/services/">Flickr API</a> provides you with an <a href="http://www.flickr.com/services/api/auth.howto.web.html">authorization workflow</a> that is particularly adapted for this device.   And Flickr members <a href="http://www.flickr.com/cameras/apple/iphone_3gs/">love their iPhones</a>.</p>
<p>An authorization workflow you say, but why? Let me step back for a moment. First you may not need to authorize your application. This is needed only if your app needs to make authenticated API calls. That means if the users of your app access in a non anonymous way the Flickrverse: accessing non-public content, commenting, tagging, deleting, etc… In order for this to happen in a safe environment (for you and our users), a <a href="http://www.flickr.com/services/api/misc.userauth.html">3-way authorization</a> needs to happen between Flickr, you and our mutual users, typical of social engineering interactions.</p>
<p>So how does this work?</p>
<h3 id="step_0">Step 0</h3>
<p>You need to setup your application.</p>
<ul>
<li><a href="http://www.flickr.com/services/apps/create/apply/">Get an API key</a> that uniquely identifies your application.</li>
<li>Configure your application to be web-based (yes, this can seem odd but this is the smoothest user experience on the iPhone) and specify the authorization callback URL (it will be used in Step 3.) I suggest not to use the http:// protocol reserved for the web but your own, like <code>myapp://</code></li>
</ul>
<p><p>There exists already a <a href="http://www.flickr.com/services/api/auth.howto.web.html">workflow explanation from developer stand point</a>, but I’d like to add the specificities introduced by the use of a <a href="http://www.flickr.com/services/api/auth.howto.web.html">web-based authorization</a> in an iPhone environment.</p>
<p>In the app, for each user you want to authorize:</p>
<h3 id="step_1">Step 1</h3>
<p>Create a login URL, specific to you application in the shape of <code>http://flickr.com/services/auth/?api_key=[api_key]&amp;perms=[perms]&amp;api_sig=[api_sig]</code> and launch a web browser with this URL.</p>
<h3 id="step_2">Step 2</h3>
<p>Flickr will ask the user to sign-in into their account and present them with a page prompting them to authorize your application.</p>
<h3 id="step_3">Step 3</h3>
<p>If the user decides to authorize your application, Flickr will call the callback URL specified in Step 0. Here is the nice trick! This can actually launch back your application. All you have to do is to add a new entry for CFBundleURLTypes in your Info.plist:</p>
<pre><code> &lt;key&gt;CFBundleURLTypes&lt;/key&gt;
 &lt;array&gt;
   &lt;dict&gt;
     &lt;key&gt;CFBundleURLName&lt;/key&gt;
     &lt;string&gt;MyApp's URL&lt;/string&gt;
     &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;
     &lt;array&gt;
       &lt;string&gt;myapp&lt;/string&gt;
     &lt;/array&gt;
   &lt;/dict&gt;
 &lt;/array&gt;
</code></pre>
<p>See Apple’s documentation on <a href="http://developer.apple.com/iPhone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/ApplicationEnvironment.html#//apple_ref/doc/uid/TP40007072-CH7-SW50">Implementing Custom URL Schemes</a> for more details.</p>
<h3 id="step_4">Step 4</h3>
<p>Your application is launched back by Flickr (through the browser and the iPhone OS) with a frob as one of the argument of the URL. The app is effectively a Flickr auth handler. You can implement application:handleOpenURL: in a similar way as:</p>
<pre><code> - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
 {
        if (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@”flickrApp”]) {
                // query has the form of "&amp;frob=", the rest is the frob
                NSString *frob = [[url query] substringFromIndex:6];

                // Keep the frob for Step 5 and schedule Step 5

               return YES;
        } else {
               Return NO;
        }
  }
</code></pre>
<p><h3 id="step_5">Step 5</h3>
<p>Your app makes an API call to <a href="(http://www.flickr.com/services/api/flickr.auth.getToken.html">convert this frob into a token</a>. The frob is valid only for a certain time. The token will be used for the API calls that require authentication. This token is what uniquely identifies the use of your API key for a specific user on Flickr. You can save it using <code>NSUserDefaults</code> for next time the user uses the application without having to reauthorize the application. Even better to use KeyChain. Note that you should use <code>checkToken</code> to make sure the user has not de-authorized the application otherwise your authenticated call may fail for no apparent reasons.</p>
<p>I would like to take the opportunity of this blog post to recommend an excellent library to develop iPhone apps interacting with flickr: <a href="http://github.com/lukhnos/objectiveflickr">ObjectiveFlickr</a>.</p>
<p>Have a good hack!</p>
<p><i><a href="http://www.flickr.com/photos/lesphotosdejerome/">Jérôme Decq</a>, from his home outside of Paris, singled handedly runs the <a href="http://www.flickr.com/groups/hackinguploadr/">Flickr Desktop Uploadr development</a>, as well as hacking on making Flickr avaiable on a wide range of platforms, and <a href="http://www.flickr.com/photos/lesphotosdejerome/2871316225/in/set-72157612623025045/">photographing purple ducks</a>. </i></p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/11/19/building-authorized-flickr-apps-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In case you wanted to bake us a cake &#8230;.</title>
		<link>http://code.flickr.com/blog/2009/11/13/in-case-you-wanted-to-bake-us-a-cake/</link>
		<comments>http://code.flickr.com/blog/2009/11/13/in-case-you-wanted-to-bake-us-a-cake/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 16:26:39 +0000</pubDate>
		<dc:creator>kellan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[quotable]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1152</guid>
		<description><![CDATA[Ian Sanchez has proposed a new geo data &#8220;test for freeness&#8221; in the spirit of the Debian project&#8217;s tests for free software.
A set of geodata, or a map, is libre only if somebody can give you a cake with that map on top, as a present. &#8211; Ian Sanchez

I mention this because the Flickr Shapefiles [...]]]></description>
			<content:encoded><![CDATA[<p>Ian Sanchez has proposed a new geo data &#8220;test for freeness&#8221; in the spirit of the <a href="http://debian.org">Debian</a> project&#8217;s tests for free software.</p>
<blockquote style="margin-right:25px;margin-left:20px;margin-bottom:30px;"><p style="font-style:italic;">A set of geodata, or a map, is libre only if somebody can give you a cake with that map on top, as a present. &#8211; <a href="http://www.opengeodata.org/2009/11/11/921/">Ian Sanchez</a></p>
</blockquote>
<p>I mention this because the <a href="http://code.flickr.com/blog/2009/05/21/flickr-shapefiles-public-dataset-10/">Flickr Shapefiles</a> can be used unencumbered as a cake decoration.  And we like cake.  We like photos of cake as well.  But we prefer cake.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/11/13/in-case-you-wanted-to-bake-us-a-cake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing The App Garden</title>
		<link>http://code.flickr.com/blog/2009/11/03/introducing-the-app-garden/</link>
		<comments>http://code.flickr.com/blog/2009/11/03/introducing-the-app-garden/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:59:30 +0000</pubDate>
		<dc:creator>mikhailp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1141</guid>
		<description><![CDATA[Flickr has long had an extensive, well-documented API. Over the years, thousands of developers have taken advantage of it, coming up with some awesome apps. We love that.
We love it so much, we&#8217;ve revamped the /services/ section of Flickr, replacing it with The App Garden. What is it, you say? It&#8217;s a place for developers [...]]]></description>
			<content:encoded><![CDATA[<p>Flickr has long had an extensive, well-documented API. Over the years, thousands of developers have taken advantage of it, coming up with some awesome apps. We love that.</p>
<p>We love it so much, we&#8217;ve revamped the /services/ section of Flickr, replacing it with The App Garden. What is it, you say? It&#8217;s a place for developers to promote their apps, right here on Flickr. We hope that it will make it easier for Flickr users to find the awesome apps that the Flickr API hackers have been building.</p>
<p>You will see that The App Garden already has some apps in it, and you might think &#8220;OOOH SHINY!!&#8221; You might also wonder how to get your app into the App Garden. I will show you!</p>
<h3>Getting Started</h3>
<p>We&#8217;ve tried to make things as simple and straight-forward as possible. You will find all of your API Keys under the <a href="http://www.flickr.com/services/apps/by/me">Apps By Me</a> page, which replaces the old API Key list. You will notice that they are all labeled as &#8220;Private&#8221; &#8211; we leave it up to you to decide when your app page is ready to be made public.</p>
<p><img class="aligncenter" src="http://farm3.static.flickr.com/2618/4072925558_3dcecdd433.jpg" alt="" width="500" height="375" /></p>
<p>When you click on one of your apps, you will be taken to the owner view of your app page. This page is where you tell the world about your app &#8211; provide a description, link to a website, set screenshots, and add tags. When you&#8217;re ready, change the privacy setting to public. That will make your app visible to other users and allow it to show up in <a href="http://www.flickr.com/services/apps/search/">searches</a>.</p>
<h3>Managing Your Apps</h3>
<p>Below the privacy settings, you will find the Admin section of the sidebar &#8211; your own little command center. You will find a link to a page with statistics for the app&#8217;s API Key (largely unchanged, though developers with higher user counts may notice a considerate speed up), as well as pages for disabling the key, editing the authentication flow for the key, and deleting the app altogether.</p>
<p>We love our API hackers and are happy to embrace them in a whole new way. We hope you like it.</p>
<h3>More Info</h3>
<p><a href="http://www.flickr.com/help/appgarden/">App Garden FAQ</a><br />
<a href="http://www.flickr.com/services/apps/about">What is the App Garden?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/11/03/introducing-the-app-garden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small Bridges (to Proximate Spaces)</title>
		<link>http://code.flickr.com/blog/2009/10/19/small-bridges-to-proximate-spaces/</link>
		<comments>http://code.flickr.com/blog/2009/10/19/small-bridges-to-proximate-spaces/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:35:55 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[machine tags]]></category>
		<category><![CDATA[noticings]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[trains]]></category>
		<category><![CDATA[web of data]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1106</guid>
		<description><![CDATA[


photo by jordi ventura

A couple months ago Tom Taylor and Tom Armitage launched a web-based game based around geotagged Flickr photos called noticin.gs.

Noticings is a game about learning to look at the world around you.
Cities are wonderful places, and everybody finds different things in them. Some of us like to take pictures of interesting, unusual, [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top:30px;margin-bottom:30px;">
<a href="http://www.flickr.com/photos/jordiventura/3955887026/"><img src="http://farm3.static.flickr.com/2611/3955887026_3bf3ae968b.jpg" width="500" height="375" style="border:1px dotted #ccc;padding:10px;" /></a><br />
</p>
<div style="font-size:small;text-align:right;">photo by <a href="http://www.flickr.com/photos/jordiventura/">jordi ventura</a></div>
</div>
<p>A couple months ago <a href="http://tomtaylor.co.uk/">Tom Taylor</a> and <a href="http://infovore.org/">Tom Armitage</a> launched a web-based game based around geotagged Flickr photos called <a href="http://noticin.gs">noticin.gs</a>.</p>
<blockquote style="border:1px solid #000;padding:20px;margin:30px;font-family:sans-serif;">
<p>Noticings is a game about learning to look at the world around you.</p>
<p>Cities are wonderful places, and everybody finds different things in them. Some of us like to take pictures of interesting, unusual, or beautiful things we see, but many of us are moving so fast through the urban landscape we don&#8217;t take in the things around us.</p>
<p>Noticings is a game you play by going a bit slower, and having a look around you. It doesn&#8217;t require you change your behaviour significantly, or interrupt your routine: you just take photographs of things that you think are interesting, or things you see. You&#8217;ll get points for just noticing things, and you might get bonuses for interesting coincidences.</p>
</blockquote>
<p>Maybe it&#8217;s just me (I don&#8217;t think so) but this is precisely the sort of thing we always hoped people would build on top of the <a href="http://www.flickr.com/services/api">Flickr API</a>.</p>
<p>You &#8220;play&#8221; noticin.gs by uploading geotagged photos to Flickr and tagging them <code><a href="http://www.flickr.com/photos/tags/noticings">noticings</a></code>. At the end of each day the noticin.gs robots query the Flickr API for new photos and assign points to each photo. Points are awarded for being the first noticing in a neighbourhood, because a player noticed something every day at lunchtime <a href="http://blog.noticin.gs/post/201650775/weekly-bonus-and-your-first-noticing-in-a">and so on</a>; the scorings change and adapt <a href="http://twitter.com/noticings/status/4993304024">with the game itself</a>.</p>
<div style="margin-top:30px;margin-bottom:30px;">
<a href="http://www.flickr.com/photos/benterrett/4001902153/"><img src="http://farm4.static.flickr.com/3491/4001902153_77f9629eb4.jpg" width="500" height="231" style="border:1px dotted #ccc;padding:10px;"/></a><br />
</p>
<div style="font-size:small;text-align:right;">photo by <a href="http://www.flickr.com/photos/benterret/">Ben Terrett</a></div>
</div>
<p>Tom Taylor and I started talking about adding the &#8220;<i>machine tags extras love</i>&#8221; (remember, that is actually now a <a href="http://code.flickr.com/blog/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/">technical term</a> on the Flickr engineering team) a while back. One idea was use the photo&#8217;s (noticin.gs) score as the key back in to their world but that seemed like an odd fit. Knowing the score for a photo doesn&#8217;t tell us how those points were awarded which is, really, the interesting part and <a href="http://blog.noticin.gs/post/214569483/flickr-machine-tags-more-fine-features">what would we link to?</a></p>
<p><i>I&#8217;ll come back to the what-do-we-link-to part again later.</i></p>
<p>As it happens, every single noticing has its own web page and a unique ID that, conveniently, is the same as the photo that was noticed so we settled on <a href="http://www.flickr.com/photos/tags/noticings:id="><code>noticings:id=PHOTO_ID</code></a> as the tag that will be &#8220;expanded&#8221;. If it&#8217;s present we&#8217;ll ask the noticin.gs servers for the list of reasons that photo was awarded points and display the one with the highest score linking back to the noticin.gs page for that ID.</p>
<p>You can either add the special machine tag yourself or ask noticin.gs to do it for you automatically. To <a href="http://noticin.gs/account/flickr_settings/edit">enable automagic machine tagging</a> you&#8217;ll need to log in to noticin.gs and change the default settings. If you&#8217;re worried about creating <i>yet another</i> account for an <i>yet another</i> online service, don&#8217;t be: noticin.gs uses the <a href="http://www.flickr.com/services/api/misc.userauth.html">Flickr Auth API</a> itself to manage user accounts so &#8220;logging in&#8221; is as simple as authorizing noticin.gs to access your Flickr account (the way you would any other Flickr API application).</p>
<p>This is what it looks like once you&#8217;ve logged in:</p>
<div style="margin-top:30px;margin-bottom:30px;">
<a href="http://noticin.gs/account/flickr_settings/edit"><img src="http://farm3.static.flickr.com/2794/4025470740_fd3fd8507b.jpg" width="494" height="497" style="border:1px dotted #ccc;padding:10px;" /></a>
</div>
<p>Paul Mison has <a href="http://notes.husk.org/post/216550687/noticings">a lovely post about noticin.gs</a> where he describes the game as &#8220;<i>the biggest change to the way I post photos</i>&#8221; to Flickr. That kind of thing makes all the bad days worth it.</p>
<p>Don&#8217;t forget: You can subscribe to <a href="http://api.flickr.com/services/feeds/photos_public.gne?tags=noticings%3Aid%3D&#038;lang=en-us&#038;format=rss_200">an RSS feed of <i>all</i> the new photos machine tagged with <code>noticings:id=</code></a> and since the photos should all be geotagged already you can also create <a href="http://api.flickr.com/services/feeds/geo/?tags=noticings%3Aid%3D&#038;lang=en-us&#038;format=kml_nl">a network link for new photos</a> and hop around from noticing to noticing in Google Earth.</p>
<p>Which is as good a segue as any to show a picture of a space ship. A &#8220;space ship.&#8221; I like this picture because it reminds me of machine tags.</p>
<div style="margin-top:30px;margin-bottom:30px;">
<a href="http://www.flickr.com/photos/mattcottam/3971780496/"><img src="http://farm3.static.flickr.com/2504/3971780496_a5f54d573d.jpg" height="375" width="500"  style="border:1px dotted #ccc;padding:10px;" /></a><br />
</p>
<div style="font-size:small;text-align:right;">photo by <a href="http://www.flickr.com/photos/mattcottam/">mattcottam</a></div>
</div>
<p>Which is as good a segue as any to talk about trains. But not just trains. <i>Machine tags for trains.</i> Actually, train stations.</p>
<p>We have a lot of pictures of train and subway stations. A casual search for the words <a href="http://www.flickr.com/search/?q=subway+OR+metro&#038;ss=2&#038;ct=0&#038;mt=all&#038;w=all&#038;adv=1">subway OR metro</a> alone yields 1.5 million results. If you add the word <a href="http://www.flickr.com/search/?ss=2&#038;mt=all&#038;adv=1&#038;w=all&#038;q=subway+OR+metro+OR+train&#038;m=text">train</a> to the list you get 5.7 million. That&#8217;s just searching for stuff in English.</p>
<p>Unfortunately, few transit systems have websites with pages dedicated to each station in their network (we&#8217;ll cut them some slack as they&#8217;re busy, you know, running the trains). A few do but none of them seem to have much in the way of a public API, even something as simple as a <code>getInfo</code> method.</p>
<p>So, a couple weekends ago I created <a href="http://fakesubwayapis.appspot.com/">Fake Subway APIs</a>, which is a plain-vanilla XML-over-HTTP API service for returning information about train and subway stations. It doesn&#8217;t do much right now except return the name and URI for a station given its short code.</p>
<p>I did this because I wanted to make sure that the code we run to determine the &#8220;meaning&#8221; of a given machine tag always expects to be asking someone else for the answer. Even if a fake subway API is little more than a canned list of IDs and names it seemed important to go through the motions of treating machine tag extras as something external to Flickr.</p>
<p>My hope is that Fake Subways APIs will become irrelevant sooner rather than later, as individual services start building this stuff themselves. For now, though, it works and it means we can enable the &#8220;<i>machine tags extras love</i>&#8221; for four transit systems: <a href="http://www.bart.gov/">BART</a> in the San Francisco Bay Area, the <a href="http://www.stm.info/">metro (STM)</a> in Montr&#233;al; <a href="http://www.tfl.gov.uk/">Transport for London</a> (aka the &#8220;Tube&#8221;) in, well, London; <a href="http://www.nationalrail.co.uk/">the National Rail Service</a> in the UK.</p>
<p>The syntax is the same for all of them:</p>
<p style="font-weight:700;text-align:center;"><code><span style="color:red;">service name</span> + ":station=" + <span style="color:red;">station code</span></code></p>
<p>Like this:</p>
<ul style="margin-left:30px;">
<li>
    <P>For BART : <code><a href="http://www.flickr.com/photos/tags/bart:station=16th">bart:station=16th</a></code></p>
<p style="font-size:small;">A complete list of BART station codes is available <a href="http://fakesubwayapis.appspot.com/bart">over here</a>.</p>
</li>
<li>
<p>For the STM (aka the &#8220;metro&#8221;) : <code><a href="http://www.flickr.com/photos/tags/stm:station=m48">stm:station=m48</a></code></p>
<p style="font-size:small;">A complete list of STM station codes is available <a href="http://fakesubwayapis.appspot.com/stm">over here</a>.</p>
</li>
<li>
<p>For TFL (aka the &#8220;Tube&#8221;) : <code><a href="http://www.flickr.com/photos/tags/tfl:station=LON-N">tfl:station=LON-N</a></code></p>
<p style="font-size:small;">TFL machine tags are a bit of a bear compared to the others. Specifically, you need to indicate both the station code <i>and</i> the line code. This is a consequence of the way the TFL website is set up. A complete list of TFL station codes is available <a href="http://fakesubwayapis.appspot.com/tfl">over here</a>.</p>
</li>
<li>
<p>For the UK National Rail System : <code><a href="http://www.flickr.com/photos/tags/ukrail:station=hmn">ukrail:station=HMN</a></code></p>
<p style="font-size:small;">A complete list of National Rail station codes is available <a href="http://fakesubwayapis.appspot.com/ukrail">over here</a>.</p>
</li>
</ul>
<p>We chose those four because they were the ones which I knew to have a webpage for each station that could be linked to (or in the case of London Underground could be teased out because, let&#8217;s be honest, it&#8217;s <a href="http://www.youtube.com/watch?v=MvSeL_LfdbA"><i>the Tube</i></a>) at the end of a machine tag.</p>
<p>Since all of this has started, hooks for the <a href="http://fakesubwayapis.appspot.com/mbta">MBTA in Boston</a> and the <a href="http://fakesubwayapis.appspot.com/ttc">TTC in Toronto</a> have been added to Fake Subway APIs so it seems reasonable to expect that we&#8217;ll add support for them here too.</p>
<p>Check it out, a train:</p>
<div style="margin-top:30px;margin-bottom:30px;margin-left:30px;">
<a href="http://www.flickr.com/photos/blork/3989036172/"><img src="http://farm3.static.flickr.com/2700/4025470816_9f50ff4def.jpg" width="427" height="287" style="border:1px dotted #ccc;padding:10px;" /></a>
</div>
<p><i>If your subway system isn&#8217;t listed please don&#8217;t take it personally. I work on this in the mornings over coffee and weekends when I&#8217;m sick and should be resting. The entire project is <a href="http://github.com/straup/gae-fakesubwayapis">open source</a> and I&#8217;d welcome contributions. <a href="http://www.flickr.com/photos/tags/ubahnmuenchen:station=">Munich</a>, for example&#8230;</i></p>
<p>One glaring omission is the New York City subway system, sometimes known as the <a href="http://mta.info/">Metropolitain Transportation Authority (MTA)</a>, because they don&#8217;t have proper webpages for the stations they operate. Fake Subway APIs provides a (fake) <a href="http://fakesubwayapis.appspot.com/mta">MTA API</a> and even has <a href="http://fakesubwayapis.appspot.com/mta/station/67">fake/place-holder subway pages</a> for each of the stations but where&#8217;s the fun in that?</p>
<p>One of the goals with the machine tags project has been to deliberately link outwards to the various sites, and services, rather than funnel everything through a single channel. A &#8220;small bridges&#8221; approach instead of an <a href="http://www.betaversion.org/~stefano/linotype/news/339/">all roads lead to</a> [INSERT BIG SITE HERE] model, so to speak.</p>
<div style="margin-top:30px;margin-bottom:30px;">
<a href="http://www.flickr.com/photos/antimega/4026171045/"><img src="http://farm3.static.flickr.com/2597/4027123760_0f8a9e3001.jpg" width="500" height="489"  style="border:1px dotted #ccc;padding:10px;" /></a><br />
</p>
<div style="font-size:small;text-align:right;">photo by <a href="http://www.flickr.com/photos/antimega/">antimega</a></div>
</div>
<p><a href="http://blog.last.fm/2009/10/19/mad-science-awesome-new-playground-apps">(Speaking of tubes&#8230;)</a></p>
<p>We&#8217;ve certainly had discussions around the idea of using <a href="http://www.wikipedia.org/">Wikipedia</a> as a sort of universal content resolution system, for things or people otherwise &#8220;missing&#8221; from the Interwebs. Tim Bray wrote a really good piece about this called &#8220;<a href="http://www.tbray.org/ongoing/When/200x/2007/01/20/On-Linking">On Linking</a>&#8221; a couple years ago. It&#8217;s not that we don&#8217;t love Wikipedia or support what they&#8217;re doing and they almost certainly have the most comprehensive list of trains stations anywhere on the Internet.</p>
<p>It&#8217;s just that we&#8217;d like to <i>actively encourage</i> as many people as possible to participate in what Tom Coates&#8217; called the &#8220;<a href="http://www.plasticbag.org/archives/2006/02/my_future_of_web_apps_slides/">Web of Data</a>&#8220;, in a presentation in 2006, making their data available to to both humans and machines but also maintaining <a href="http://mike.teczno.com/notes/gosm.html">authorship</a> of all that crunchy goodness. Tom&#8217;s slides are a bit opaque on their own and to date the best telling of the presentation has been <a href="http://web.archive.org/web/20060222191310/http://simon.incutio.com/notes/2006/summit/coates.txt">Simon Willison and company&#8217;s collaborative note-taking</a>, which I&#8217;ve liberally excerpted here:</p>
<blockquote style="border:1px solid #000;padding:20px;margin:30px;font-family:sans-serif;">
<p>Every new service that you create can potentially build on top of every other existing service.</p>
<p>Every service and piece of data that&#8217;s added to the web makes every other service potentially more powerful.</p>
<p>So the same things that keep the hippies happy keep the evil capitalists happy. They all have to play in the same ecosystem. If not, you end up in a backwater, disconnected from the cool stuff that&#8217;s happening. strength in sharing and participating.</p>
</blockquote>
<p>So far, it&#8217;s an idea that worked pretty well for us if all the amazing stuff people have built on to top of the API is any measure.</p>
<p><i>If you look closely you&#8217;ll notice that I&#8217;ve had to link to an (<a href="http://www.archive.org/">Internet Archive</a>) archived version of Simon&#8217;s site from 2006 since the notes are nowhere else to be found. There is still, obviously, lots of work left to be done no matter which road you prefer.</i></p>
<p><i>Also: While we&#8217;re talking about Wikipedia,  Josh Clark&#8217;s <a href="http://hackday.bigmedium.com/about.html">Wikipedia Machine Tag Generator</a>, which he built during the <a href="http://flickr.com/photos/tags/upcoming:event=173371">Yahoo! BBC Hack Day</a> event in 2007, is just plain awesome.</i></p>
<p>So, where are we going with all of this? It&#8217;s a bit too soon to tell but one of the things I like about all of the recent machine tag work is that they <a href="http://www.flickr.com/photos/fesz/4022379229/">start to expose geographies</a> outside of the traditional grid of latitudes and longitudes. If that sounds a bit wooly and hand-wavey that&#8217;s because it is.</p>
<p>In concrete terms, one thing that&#8217;s pretty exciting is the ability to infer location for all those photos that aren&#8217;t geotagged yet but do have <a href="http://www.flickr.com/photos/tags/upcoming:*=">Upcoming</a>, or <a href="http://www.flickr.com/photos/tags/foursquare:*=">foursquare</a>, or <a href="http://www.flickr.com/photos/tags/osm:*=">OpenStreetMap</a> machine tags or, yes, even <a href="http://www.flickr.com/photos/tags/*:station=">train stations</a>. All those services have their own APIs and aside from just pulling back coordinates you can use them to fill in simple, but important, details like whether a photo was taken <a href="http://www.flickr.com/groups/geotagging/discuss/72157614917708443/">indoors or outdoors</a>.</p>
<p>And if we&#8217;re lucky they&#8217;ll start to show us the <a href="http://code.flickr.com/blog/2009/01/12/living-in-the-donut-hole/">donut holes</a> and the &#8220;<a href="http://en.wikipedia.org/wiki/Place_cell">place fields</a>&#8221; (<i>props to <a href="http://delicious.com/blackbeltjones/">Matt Jones&#8217; delicious links</a> for that one</i>) that we walk through every day but don&#8217;t recognize or don&#8217;t have names for yet.</p>
<div style="margin-top:30px;margin-bottom:30px;margin-left:100px;">
<a href="http://www.flickr.com/photos/jlbove/3873804775/"><img src="http://farm3.static.flickr.com/2573/3873804775_566abee749.jpg" width="375" height="500"  style="border:1px dotted #ccc;padding:10px;" /></a></p>
<p></p>
<div style="font-size:small;text-align:right;">photo by <a href="http://www.flickr.com/photos/jlbove/">JLB</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/10/19/small-bridges-to-proximate-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;That&#8217;s maybe a bit too dorky, even for us.&#8221;</title>
		<link>http://code.flickr.com/blog/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/</link>
		<comments>http://code.flickr.com/blog/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 17:50:26 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[machine tags]]></category>
		<category><![CDATA[open street maps]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1094</guid>
		<description><![CDATA[

photo by rabbitier

Around the time we added support for Open Plaques machine tags Frankie Roberto, the project lead, asked: &#8220;What about supporting Open Street Map (OSM) way machine tags?&#8221;
My immediate response was something along the lines of &#8220;That&#8217;s maybe a bit too dorky, even for us.&#8221; Which meant that I kept thinking about it. And [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-bottom:30px;margin-top:30px;">
<a href="http://www.flickr.com/photos/rabbitier/3776861543/"><img src="http://farm4.static.flickr.com/3562/3776861543_d3f69d390b.jpg" width="500" height="322" style="border:1px dotted #ccc;padding:10px;margin-bottom:10px;"/></a></p>
<p style="font-size:small;text-align:right;"><a href="http://www.flickr.com/photos/rabbitier/">photo by rabbitier</a></p>
</div>
<p>Around the time we added <a href="http://www.frankieroberto.com/weblog/1454">support for Open Plaques machine tags</a> Frankie Roberto, the project lead, asked: &#8220;What about supporting Open Street Map (OSM) <code>way</code> machine tags?&#8221;</p>
<p>My immediate response was something along the lines of &#8220;That&#8217;s maybe a bit too dorky, even for us.&#8221; Which meant that I kept thinking about it. And now we&#8217;re doing it.</p>
<p>If you&#8217;re not sure way what a &#8220;way&#8221; is, it&#8217;s best to start with OpenStreetMap&#8217;s own description of <a href="http://wiki.openstreetmap.org/wiki/Elements">how their metadata is structured</a>:</p>
<blockquote style="border-top:solid thin; border-bottom:solid thin;font-family:monospace;margin-top:20px;margin-bottom:20px;padding:20px;font-size:small;">
<p>Our maps are made up of only a few simple elements, namely nodes, ways and relations. Each element may have an arbitrary number of properties (a.k.a. Tags) which are Key-Value pairs (e.g. highway=primary) &#8230;</p>
<p>A node is the basic element of the OSM scheme. Nodes consist of latitude and longitude (a single geospacial point) &#8230;</p>
<p>A way is an ordered interconnection of at least 2 and at most 2000 nodes that describe a linear feature such as a street, or similar. Should you reach the node limit simply split your way and group all ways in a relation if necessary. Nodes can be members of multiple ways.</p>
</blockquote>
<p>Frankie&#8217;s interest is principally in marking up buildings in and around Manchester, where he lives. When he <a href="http://www.flickr.com/photos/frankieroberto/3396068360/">tags one of his photos with <code>osm:way=30089216</code></a> we can fetch the metadata (the key-value pairs) for that way <a href="http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.6#Read:_GET_.2Fapi.2F0.6.2F.5Bnode.7Cway.7Crelation.5D.2F.23id">using the OSM API</a> and see that it has the following properties:</p>
<pre style="margin-bottom:30px;">
&lt;osm version=&quot;0.6&quot; generator=&quot;OpenStreetMap server&quot;&gt;
	&lt;way id=&quot;30089216&quot; visible=&quot;true&quot; timestamp=&quot;2009-07-04T12:02:47Z&quot; version=&quot;2&quot; changeset=&quot;1728727&quot; user=&quot;Frankie Roberto&quot; uid=&quot;515&quot;&gt;
		&lt;nd ref=&quot;331415447&quot;/&gt;
		&lt;nd ref=&quot;331415448&quot;/&gt;
		&lt;nd ref=&quot;331415449&quot;/&gt;
		&lt;nd ref=&quot;331415450&quot;/&gt;
		&lt;nd ref=&quot;331415447&quot;/&gt;
		&lt;tag k=&quot;architect&quot; v=&quot;Woodhouse, Corbett &amp; Dean&quot;/&gt;
		<b style="color:pink;">&lt;tag k=&quot;building&quot; v=&quot;yes&quot;/&gt;</b>
		&lt;tag k=&quot;created_by&quot; v=&quot;Potlatch 0.10f&quot;/&gt;
		<b style="color:pink;">&lt;tag k=&quot;name&quot; v=&quot;St George&#x27;s House&quot;/&gt;</b>
		&lt;tag k=&quot;old_name&quot; v=&quot;YMCA&quot;/&gt;
		&lt;tag k=&quot;start_date&quot; v=&quot;1911&quot;/&gt;
	&lt;/way&gt;
&lt;/osm&gt;
</pre>
<p>That allows to us &#8220;expand&#8221; the original machine tag and display a short caption next to the photo, in this case: <i>&#8220;St George&#8217;s House is a building in OpenStreetMap&#8221;</i> with a link back to <a href="http://www.openstreetmap.org/browse/way/30089216">the web page for that way on the OSM site</a>.</p>
<div style="margin-bottom:30px;margin-top:30px;">
<a href="http://www.flickr.com/photos/mbiddulph/3888509266/"><img src="http://farm4.static.flickr.com/3486/3888509266_374b161456.jpg" width="500" height="333" style="border:1px dotted #ccc;padding:10px;margin-bottom:10px;" /></a></p>
<p style="font-size:small;text-align:right;"><a href="http://www.flickr.com/photos/mbiddulph/">photo by Matt Biddulph</a></p>
</div>
<p>The technical terms for this process is &#8220;<a href="http://code.flickr.com/blog/2009/07/06/extraextraextra/">Adding the machine tags extra love</a>&#8220;.</p>
<p>You may have noticed that there are a bunch of other key-value pairs in that example, like the name of the architect, that we don&#8217;t do anything with. Which attributes are we looking for, then? The short answer is: Not most of them. The <a href="http://wiki.openstreetmap.org/index.php/Map_features">complete list of map features in OSM</a> is a bit daunting in scope and constantly changing. It would be nice to imagine that we could keep pace with the discussions and the churn but that&#8217;s just not going to happen. If nothing else, the translations alone would become unmanageable.</p>
<p>Instead we&#8217;re going to start small and see where it takes us. Here are the list of tagged features in a <code>way</code> or <code>node</code> definition that we pay attention to, and how they&#8217;ll be displayed:</p>
<ul style="margin-bottom:30px;">
<li>
<p><b>k=name v={NAME}</b><br /> &#8230; is a feature in OpenStreetMap <i>(If present, with another recognized tag we will display the name for the thing being described in place of the more generic &#8220;this is a&#8230;&#8221;)</i></p>
</li>
<li>
<p><b>k=building v=yes</b><br /> &#8230; is a building in OpenStreetMap</p>
</li>
<li>
<p><b>k=historic</b><br />&#8230; is an historic site in OpenStreetMap
        </li>
<li>
<p><b>k=cycleway</b><br /> &#8230; is a bicycle path in OpenStreetMap</p>
</li>
<li>
<p><b>k=motorway (v=cycleway)</b><br /> &#8230; is a highway in OpenStreetMap <i>(unless <strong>v</strong> is &#8220;cycleway&#8221; in which case it&#8217;s a bike path)</i></p>
</li>
<li>
<p><b>k=railway v=subway <i>(or tram or monorail or light_rail)</i></b><br /> &#8230; is a subway <i>(or tram or monorail or light_rail)</i> line in OpenStreetMap</p>
</li>
<li>
<p><b>k=railway v=station</b><br /> &#8230; is a train station in OpenStreetMap; if the type of railway is also defined (above) then we&#8217;ll be specific about the type of station. <i>I should mention that as of this writing we&#8217;re still waiting for the translations for &#8220;this is a train station&#8221; to come back because I, uh&#8230; anyway, real soon now.</i></p>
</li>
<li>
<p><b>k=waterway v=stream <i>(or canal or river)</i></b><br /> &#8230; this is a stream <i>(or canal or river)</i> in OpenStreetMap</p>
</li>
<li>
<p><b>k=landuse v=farm <i>(or forest)</i></b><br /> &#8230; this is a farm <i>(or forest)</i> in OpenStreetMap</p>
</li>
<li>
<p><b>k=natural v=forest <i>(or beach)</i></b><br /> &#8230; this is a forest <i>(or beach)</i> in OpenStreetMap</p>
</li>
</ul>
<p>Which means: We&#8217;ve almost certainly got at least some of it wrong. Anyone familiar with OSM features will probably be wondering why we haven&#8217;t included <code><a href="http://wiki.openstreetmap.org/index.php/Map_features#Amenity">amentiy</a></code> or <code><a href="http://wiki.openstreetmap.org/index.php/Map_features#Shop">shop</a></code> tags since they contain a wealth of useful information. I hope we will, but it wasn&#8217;t clear how we should decide which features to support (more importantly, which to exclude) and the number of possible combinations were starting to get a bit out of hand and we have this little photo-sharing site to keep running.</p>
<p style="font-style:italic;">This is the part where I casually mention that we&#8217;ve also added <a href="http://www.flickr.com/photos/tags/foursquare:venue=">machine tags extra love for Four Square venues IDs</a>. I&#8217;m just saying&#8230;</p>
<p>The features we&#8217;re starting with may seem a bit odd, with a heavy focus on natural land features (and train stations). Some of this is a by-product of the work we&#8217;ve been pursuing with the <a href="http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/">alpha shapes and &#8220;donut holes&#8221;</a>, derived from geotagged photos, and some of it is just trying to shine the spotlight on places and environments that we take for granted.</p>
<p>Like I said, we&#8217;ve almost certainly got at least some of it wrong but hopefully we got part of it right and can correct the rest as we go. This one is definitely a bit more of an experiment than some of the others.</p>
<div style="margin-bottom:30px;margin-top:30px;">
<a href="http://www.flickr.com/photos/artistofmimicry/2977379629/in/set-72157607092403287/"><img src="http://farm4.static.flickr.com/3160/2977379629_b6263b39da.jpg" height="500" width="362" style="border:1px dotted #ccc;padding:10px;margin-left:50px;margin-bottom:10px;" /></a></p>
<p style="font-size:small;text-align:right;"><a href="http://www.flickr.com/photos/artistofmimicry/">photo by artistofmimicry</a></p>
</div>
<p>Finally, in the tangentially related department we finished wiring up the RSS/syndication feeds to work properly with wildcard machine tags. That means you can subscribe to a feed of all the (public) photos tagged with <code><a  href="http://api.flickr.com/services/feeds/photos_public.gne?tags=osm%3Away%3D&#038;lang=en-us&#038;format=rss_200">osm:way=</a></code> or <code><a href="http://api.flickr.com/services/feeds/photos_public.gne?tags=osm%3Anode%3D&#038;lang=en-us&#038;format=rss_200">osm:node=</a></code> or, if you&#8217;re like me, all the photos of places to eat in <a href="http://www.dopplr.com/">Dopplr</a> with <code><a href="http://api.flickr.com/services/feeds/photos_public.gne?tags=dopplr%3Aeat%3D&#038;lang=en-us&#038;format=rss_200">dopplr:eat=</a></code>.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickr is hiring</title>
		<link>http://code.flickr.com/blog/2009/09/18/flickr-is-hiring/</link>
		<comments>http://code.flickr.com/blog/2009/09/18/flickr-is-hiring/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 18:23:54 +0000</pubDate>
		<dc:creator>jude</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jobs]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1087</guid>
		<description><![CDATA[We&#8217;re looking for a few talented geeks to join our panda-wrangling, daily-deploying, shard-juggling squad, based in downtown San Francisco.
Flickr has openings for PHP and Front-end Engineers, an Engineering Manager, a MySQL DBA, Product Managers and a Designer.

If you think that you&#8217;ve got the chops, hop over to our jobs page for information on how to [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re looking for a few talented geeks to join our panda-wrangling, daily-deploying, shard-juggling squad, based in downtown San Francisco.</p>
<p>Flickr has openings for PHP and Front-end Engineers, an Engineering Manager, a MySQL DBA, Product Managers and a Designer.</p>
<p><a href="http://www.flickr.com/photos/marals/3821484254/" title="papa: working on the Univac by maralina!, on Flickr"><img src="http://farm3.static.flickr.com/2565/3821484254_c0b71fdab7.jpg" width="500" height="415" alt="papa: working on the Univac" /></a></p>
<p>If you think that you&#8217;ve got the chops, hop over to our <a href="http://www.flickr.com/jobs/">jobs page</a> for information on how to apply.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/09/18/flickr-is-hiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Introducing astrotags&#8221;</title>
		<link>http://code.flickr.com/blog/2009/09/16/introducing-astrotags/</link>
		<comments>http://code.flickr.com/blog/2009/09/16/introducing-astrotags/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 19:49:39 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astrotagging]]></category>
		<category><![CDATA[machine tags]]></category>
		<category><![CDATA[robots]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1062</guid>
		<description><![CDATA[


The Royal Observatory Greenwich has posted an absolutely lovely video about &#8220;astrotags&#8220;, writing:

&#8220;Astrotags are a new way to label your astronomy photos with their celestial subject and its location. This short film, made by Jim Le Fevre and Mike Paterson for the Royal Observatory&#8217;s Astronomy Photographer of the Year exhibition, shows you how. So have [...]]]></description>
			<content:encoded><![CDATA[<div style="border:1px dotted #ccc; padding:10px;width:400px;margin-bottom:30px;margin-top:20px;margin-left:15px;">
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6469344&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=0e7df3&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6469344&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=0e7df3&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
</div>
<p>The <a href="http://www.nmm.ac.uk/places/royal-observatory/">Royal Observatory Greenwich</a> has posted an absolutely lovely video about &#8220;<a href="http://www.flickr.com/photos/tags/astro:*=">astrotags</a>&#8220;, writing:</p>
<blockquote style="padding-left:15px;padding-right:15px;font-family:sans-serif;">
<p>&#8220;Astrotags are a new way to label your astronomy photos with their celestial subject and its location. This short film, made by Jim Le Fevre and Mike Paterson for the Royal Observatory&#8217;s <a href="http://www.nmm.ac.uk/places/royal-observatory/international-year-of-astronomy/">Astronomy Photographer of the Year exhibition</a>, shows you how. So have a watch, then astrotag your pictures at the <a href="http://www.flickr.com/groups/astrophoto/">Astronomy Photographer of the Year group on Flickr</a>. If everyone joins in we can make a beautiful and accurate map of the night sky&#8230; so pass the word on.&#8221;</p>
</blockquote>
<p>We&#8217;ve written about astrotags before, in a couple of posts titled &#8220;<a href="http://code.flickr.com/blog/2009/02/18/found-in-space/">Found in Space</a>&#8221; and &#8220;<a href="http://code.flickr.com/blog/2009/03/20/tags-in-space/">Tags in Space</a>&#8220;, and earlier this year <a href="http://www.indicommons.org/2009/02/24/interview-meet-the-digital-media-team-at-the-national-maritime-museum/">Fiona Romeo</a>, Head of Digital Media at the <a href="http://www.flickr.com/photos/nationalmaritimemuseum/">National Maritime Museum</a>, spoke about the Observatory&#8217;s astrotagging project asking the question <i>&#8220;what&#8217;s the space equivalent of geotagging&#8221;?</i>  at <a href="https://www.webstock.org.nz/talks/speakers/fiona-romeo/astrotagging-bots-and-citizen-scientists/">Webstock09</a>.</p>
<div style="border:1px dotted #ccc; padding:10px;width:400px;margin-bottom:30px;margin-top:20px;margin-left:15px;">
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4717981&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4717981&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
</div>
<p>Tangentially related, we&#8217;ve also updated the <a href="http://code.flickr.com/blog/2008/07/18/wildcard-machine-tag-urls/">wildcard machine tag pages</a> to display related tags based on the current namespace or predicate. For example, if you go to <a href="http://www.flickr.com/photos/tags/astro:name=/">/photos/tags/astro:name=</a> you&#8217;ll see these other related tags in the sidebar on the left:</p>
<div style="border:1px dotted #ccc; padding:10px;width:488px;margin-bottom:30px;margin-top:20px;margin-left:15px;">
<img src="http://farm3.static.flickr.com/2573/3927033002_4b4d5173d2_o.png" width="488" height="331" alt="Picture 10" />
</div>
<p>Now we just need people to make some <a href="http://blog.flickr.net/en/2009/09/14/galleries-unleash-your-inner-curator/">astrotagging galleries!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/09/16/introducing-astrotags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 questions for Matt Biddulph</title>
		<link>http://code.flickr.com/blog/2009/07/27/5-questions-for-matt-biddulph/</link>
		<comments>http://code.flickr.com/blog/2009/07/27/5-questions-for-matt-biddulph/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 17:24:27 +0000</pubDate>
		<dc:creator>kellan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[5 questions]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1053</guid>
		<description><![CDATA[
Matt Biddulph takes lovely photos.  And apparently when he isn&#8217;t taking photos he find times to be the founder and CTO of Dopplr.  Which makes us happy, because we&#8217;re big Dopplr fans.  If Flickr is the site where photos become social objects, Dopplr is that site for travel.  Except with personal [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/blech/437968953/" title="Matt Biddulph by blech​, on Flickr"><img src="http://farm1.static.flickr.com/175/437968953_29b23353c9_t.jpg" width="100" height="67" alt="Matt Biddulph" style="float: right; margin-left: 20px; margin-bottom: 20px;" /></a></p>
<p><a href="http://www.flickr.com/photos/mbiddulph/">Matt Biddulph</a> takes lovely photos.  And apparently when he isn&#8217;t taking photos he find times to be the founder and CTO of <a href="http://dopplr.com">Dopplr</a>.  Which makes us happy, because we&#8217;re big Dopplr fans.  If Flickr is the site where photos become social objects, Dopplr is that site for travel.  Except with personal informatics, and positionally dependent rainbows. (we have a well documented weakness for rainbows)</p>
<p>Dopplr is consistently one of the most interesting projects tying together the loosely joined datastreams into a cohesive whole, and Matt&#8217;s meditations on how to do that are not to be missed. </p>
<p><a href="http://www.flickr.com/photos/mbiddulph/3171150564/" title="Dopplr personal informatics coffeecup by Matt Biddulph, on Flickr"><img src="http://farm4.static.flickr.com/3093/3171150564_9f272aa2c8.jpg" width="500" height="333" alt="Dopplr personal informatics coffeecup" /></a></p>
<p><b>1. What are you currently building that integrates with Flickr, or a past favorite that you think is cool, neat, popular and worth telling folks about? Or both.</b></p>
<p><i>Matt:</i> I&#8217;m the CTO at <a href="http://dopplr.com">Dopplr</a>, and we use Flickr all over our site to integrate our users&#8217; travel pictures and illustrate places in our &#8220;Social Atlas&#8221;. We&#8217;re particularly happy with <a href="http://code.flickr.com/blog/2009/07/06/extraextraextra/">Flickr&#8217;s recent integration of Dopplr places into their automatic machine tag handling</a></p>
<p>This year we&#8217;ve been radically upgrading our city information pages (e.g. <a href="http://dplr.it/san-francisco">http://dplr.it/san-francisco</a>) and Flickr photos have been an important part of that. Designer Matt Jones came up with a combination of rich information visualisation and beautiful images, combining sparklines with photos of cities that we source from Flickr&#8217;s geotagged Creative-Commons licensed contributions.</p>
<p>The Flickr API is key to how these pages are made. Although &#8216;interestingness&#8217; is a powerful sorting metric, we found that just asking for the most interesting picture of a city didn&#8217;t always give us the right aesthetic (just as Dan Catt&#8217;s pandas <a href="http://code.flickr.com/blog/2009/03/03/panda-tuesday-the-history-of-the-panda-new-apis-explore-and-you">occasionally show a preference for bikinis</a>). Instead, our developer <a href="http://jerakeen.org/">Tom Insam</a> built a workflow tool that shows site admins a list of the top pictures per place. It displays a preview of a sample data visualisation overlay, and limits the pictures to those licensed for derivative commercial works.</p>
<p>An admin can quickly work through our most popular cities, choosing pictures and a few design settings (such as whether to use black or white text for best contrast). Once a month, a script runs through our chosen images, regenerating this month&#8217;s data viz and removing any photos whose license has changed since our last check. This happens more often than we expected.</p>
<p><b>2. What are the best tricks or tips you&#8217;ve learned working with the Flickr API?</b></p>
<p><i>Matt:</i> To make our city page Flickr integration possible, we had to correlate our city database with Flickr&#8217;s geotagging data. Our data is sourced from <a href="http://www.geonames.org">GeoNames</a> and augmented by us and our users. Luckily <a href="http://www.flickr.com/services/api/flickr.places.find.html">Flickr provides a handy reverse-geocoder</a> that maps a latitude/longitude point to an identifier. As a bonus, Flickr now uses the same &#8220;WOE IDs&#8221; as <a href="http://developer.yahoo.com/geo/">Yahoo&#8217;s Geo APIs</a>, meaning that this correlation between our IDs and theirs can be used to lookup other rich geo data elsewhere on our site. We also started supporting WOE IDs in our own API in return, and we were very happy when Flickr started linking to our city pages from their own place pages.</p>
<p>Another tip for integrating Flickr API calls into web pages is to consider whether you can achieve a feature with purely client-side code. Rather than have our webserver tied up waiting for an HTTP request to return from Flickr, in certain places we serve up jQuery code to perform Flickr queries from the clientside, inserting the results into the page via ajax.</p>
<p><b>3. As a Flickr developer what would you like to see Flickr do more of and why?</b></p>
<p><i>Matt:</i> I&#8217;m in complete agreement with Kellan &#8212; <a href="http://laughingmeme.org/2009/03/04/is-a-firehose-of-snowflakes-a-noreaster/">that realtime APIs are going to be big</a>. For example, I want the ability to register an interest in something (&#8220;the latest CC-licensed photos of London&#8221;) and get the data pushed to me whenever new results are ready. This might be implemented using <a href="http://webhooks.pbworks.com/">Web Hooks</a>, like when github makes an HTTP POST for you whenever you push into a repository. It might be over <a href="http://fireeagle.yahoo.net/developer/documentation/xmpp_faq">XMPP, as used by Fire Eagle</a>, when services register for publish-subscribe notifications of new location pings. The choice of technology is less important than the new possibilities (and design challenges) of the realtime web.</p>
<p><b>4. What excites you about Flickr and hacking? What do you think you&#8217;ll build next or would like someone else to build so you don&#8217;t have to?</b></p>
<p><i>Matt:</i> The best thing about Flickr for hacking is the sheer amount of data that the community collects. The recent release of <a href="http://code.flickr.com/blog/2009/05/21/flickr-shapefiles-public-dataset-10/">shapefiles derived from tags and geotagging</a> is very exciting and has huge possibilities for geo mashups. I&#8217;m looking forward to firing up a <a href="http://mapsfromscratch.com/">Maps From Scratch</a> instance and figuring out how to combine it with data from our service. There are some screenshots of <a href="http://code.flickr.com/blog/2009/04/07/the-only-question-left-is/">my early experiments using Flickr&#8217;s clustr tool</a> on our Social Atlas data at http://www.flickr.com/photos/mbiddulph/tags/clustr/</p>
<p><b>5. Besides your own, what Flickr projects and hacks do you use on a regular basis? Who should we interview next?</b></p>
<p><i>Matt:</i> I nominate Dave Beckett, author of the C library and commandline tool <a href="http://librdf.org/flickcurl">Flickcurl</a> because I use the commandline tool as a quick interface to Flickr data all the time. As a devotee of dynamic languages, I&#8217;m interested to hear about what it&#8217;s like to program the web in C.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/07/27/5-questions-for-matt-biddulph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>horse=yes</title>
		<link>http://code.flickr.com/blog/2009/07/22/horseyes/</link>
		<comments>http://code.flickr.com/blog/2009/07/22/horseyes/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 21:22:26 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[osm]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1014</guid>
		<description><![CDATA[   ]]></description>
			<content:encoded><![CDATA[<div style="margin-bottom:30px;margin-top:20px;">
		<a href="http://www.flickr.com/photos/straup/3709466805/" title="a map Jason Bourne could eat cake on by straup, on Flickr"><img src="http://farm3.static.flickr.com/2585/3709466805_5665c4751a.jpg" width="500" height="290" alt="a map Jason Bourne could eat cake on" style="border:none;padding:10px;" /></a
	</div>
<blockquote style="margin-right:25px;margin-left:20px;margin-bottom:30px;">
<p style="font-style:italic;">Yes, I got a bit emotional at the third OpenStreetMap conference, held in the CCC, Amsterdam last weekend &#8212; mainly because this globe we are on is the only one we know &#8212; we really are mapping our universe, doing it our way. Creating the world we want to live in. I thought it worth while to say &#8220;Thanks&#8221; to some people. Being British, the feeling of being a bit foolish stopped me from being too effusive!</p>
<p style="text-align:right;font-size:small;">&#8212; <a href="http://thinkwhere.wordpress.com/2009/07/15/were-making-the-world-weve-always-wanted-to-live-in-sotm09/">Tim Waters</a></p>
</blockquote>
<p>A couple weeks ago I had the pleasure of attending, and the privilege of speaking at, the <a href="http://www.stateofthemap.org/">State of the Map</a> conference in Amsterdam. I told the story of how we came to use <a href="http://www.openstreetmap.org/">Open Street Maps</a> (OSM), how it works on the backend and talked a little bit about what we&#8217;d like to do next: Moving beyond &#8220;bags of tiles&#8221;, a better way to keep up to date with changes to the OSM database and, for good measure, a little bit of tree-hugging at the end.</p>
<div style="margin-left:35px;text-align:center;margin-bottom:30px;margin-top:20px;padding:10px;border:1px dotted #ccc; width:425px;max-width:425px;">
		<object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sotm-090710141740-phpapp01&#038;stripped_title=communities-of-authority" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sotm-090710141740-phpapp01&#038;stripped_title=communities-of-authority" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
		</div>
<p>Most of all, though, I wanted to take the opportunity to thank the OSM community. To thank them for making Flickr, the thing that we care about and work on all day, better. To thank them for proving the nay-sayers wrong.</p>
<p>To say that OSM started with an audacious plan (to map the entire world by &#8220;hand&#8221; one neighbourhood and one person at a time) would be an understatement. You would have been forgiven, at the time, for laughing.</p>
<p>And yet, in a few short years they are well on their way having nurtured both a community of users and an infrastructure of tools that makes it hard to ever imagine a world <i>without</i> Open Street Maps. In the U.K. alone, as <a href="http://www.slideshare.net/mukih/beyond-good-enough-spatial-data-quality-and-openstreetmap-data">Muki Haklay demonstrated</a>, they have produced a free and open dataset whose coverage and fidelity rivals those created by the <a href="http://en.wikipedia.org/wiki/Ordnance_Survey">Ordinance Survey</a> with its government funding and 250-year head start.</p>
<p>That is really exciting both because of the opportunities that such a rich and comprehensive dataset provide but also because it proves what is <i>possible</i>. The Internets are still a pretty great place that way.</p>
<div  style="margin-bottom:30px;margin-top:20px;">
<a href="http://www.flickr.com/photos/russelldavies/3728537691/" title="mugs by russelldavies, on Flickr"><img src="http://farm3.static.flickr.com/2594/3728537691_39b1c79c44.jpg" width="500" height="375" alt="mugs"  style="border:1px dotted #ccc;padding:10px;margin-bottom:10px;" /></a><br />
</p>
<div style="text-align:right;font-size:small;">photo by <a href="http://www.flickr.com/photos/russelldavies/">russelldavies</a></div>
</div>
<p>There were too many excellent talks to list them all, but here&#8217;s a short (ish) list that betrays some of my interests and biases:</p>
<ul style="margin-left:25px;margin-right:20px;font-family:sans-serif;">
<li>
<p><a href="http://www.slideshare.net/harrywood/sotm09-talk-community-smoothness">Harry Wood&#8217;s talk on tagging in OSM</a>. I actually missed this talk and after seeing the slides I am doubly disappointed. Open Street Map is not just the raw geographic  data that people collect but also all the metadata that is used to describe it. OSM uses a simple tagging system for recording &#8220;<a href="http://wiki.openstreetmap.org/wiki/Mapfeatures">map features</a>&#8221; and Harry&#8217;s talk on managing the chaos, navigating the disputes and juggling the possibilities looked like it was really interesting.</p>
<p><i>(The title of this post is, in fact, a gentle poke at the black sheep of the OSM tagging world. There really are map features tagged &#8220;<a href="http://quakr.blogspot.com/2007/07/state-of-openstreetmap-horseyes-again.html">horse=yes</a>&#8221; which is mostly hilarious until you remember how much has been accomplished with a framework that allows for tags like that.)</i></p>
</li>
<li>
<p>The Sunday afternoon maps-and-history love-fest that included Frankie Roberto&#8217;s &#8220;<a href="http://www.slideshare.net/frankieroberto/mapp-history-on-open-street-map">Mapping History on Open Street Map</a>&#8220;, Tim Water&#8217;s &#8220;<a href="http://www.slideshare.net/chippy/open-historical-maps-at-state-of-the-map-sotm-2009-amsterdam">Open Historical Maps</a>&#8221; and the Dutch Nationaal Archief&#8217;s presenting &#8220;<a href="http://www.slideshare.net/kennisland/mapit1418">MapIt 1418</a>&#8220;, a project to allow users to add suggested locations for their photos in the <a href="http://www.flickr.com/photos/nationaalarchief/">Flickr Commons</a>!</p>
<p><i>Tim&#8217;s been doing work for <a href="http://www.flickr.com/photos/nypl/">The New York Public Library</a>, another Flickr Commons member, and MapWarper (the code that powers the <a href="http://dev.maps.nypl.org/warper/">NYPL&#8217;s historical map rectifier</a>) is an open source project and available on <a href="http://github.com/timwaters/mapwarper/tree">GitHub</a>.</i></p>
</li>
<li>
<p>Mikel Maron&#8217;s &#8220;<a href="http://vimeo.com/5607286">Free and Open Palestine</a>&#8221; (the slides are <a href="http://www.slideshare.net/mikel_maron/free-and-open-palestine">here</a> but you should really watch the video) which is an amazing story of collecting map data in the West Bank and Gaza.</p>
<p><i>Mikel was also instrumental in creating a <a href="http://www.stateofthemap.org/2009/06/22/osi-scholarships/">scholarship program to pay the travel and lodging expenses for 15 members from the OSM community</a>, from all over the world, to attend the conference. Because he&#8217;s kind of awesome, that way.</i></p>
</li>
</ul>
<p>But that&#8217;s just me. I&#8217;d encourage you to spend some time poking around all the other presentations that are available online:</p>
<ul style="margin-left:25px;margin-right:20px;font-family:sans-serif;">
<li>
<p><a href="http://www.slideshare.net/tag/sotm09">Presentations tagged &#8220;sotm09&#8243; on Slideshare.</a></p>
</li>
<li>
<p><a href="http://vimeo.com/sotm09">Videos tagged &#8220;sotm09&#8243; on Vimeo.</a></p>
</li>
<li>
<p><a href="http://www.flickr.com/photos/tags/sotm09">Photos tagged &#8220;sotm09&#8243; on Flickr</a></p>
</li>
<li>
<p><a href="http://wiki.openstreetmap.org/wiki/State_Of_The_Map_2009">The complete State of the Map schedule on the OSM website</a></p>
</li>
</ul>
<p>Despite the &#8220;bag of tiles&#8221; approach for using OSM on Flickr getting a bit old it still works so as of right here, right now:</p>
<ul style="margin-left:25px;margin-right:20px;font-family:sans-serif;">
<li>
<p>In <a href="http://www.flickr.com/places/vietnam/">Vietnam</a>, we&#8217;ve added OSM tiles for <a href="http://www.flickr.com/map?place_id=L.CstOiYA5_7VNSt">Ha Noi</a> and <a href="http://www.flickr.com/map?place_id=3wLzgz6YA5ns4Pn0">Ho Chi Minh City</a> <i>(see also: <a href="http://www.slideshare.net/khanhlnq/state-of-vietnam">The State of Vietnam</a>)</i>.</p>
</li>
<li>
<p>In <a href="http://www.flickr.com/places/cuba/">Cuba</a>, we&#8217;ve added OSM tiles for <a href="http://www.flickr.com/map?place_id=5mns2QSfApT9oA">Havana</a> <i>(see also: <a href="http://www.slideshare.net/elpbatista/elpbatista-sotm09-lightning-talk">The State of Cuba</a>)</i>.</p>
</li>
<li>
<p>In <a href="http://www.flickr.com/places/chile">Chile</a>, we&#8217;ve added OSM tiles for <a href="http://www.flickr.com/map?place_id=KFMRRQOaBZW2bNE">Santiago</a> <i>(if there was a State of Chile presentation I missed it and haven&#8217;t found any slides online so instead I&#8217;ll just link to this <a href="http://www.openstreetmap.org/user/Zambelli%20Limitada/diary/2598">lovely localized version of OSM for Chilean users</a>)</i>.</p>
</li>
</ul>
<p>We&#8217;ve also refreshed the tiles for <a href="http://www.flickr.com/map?place_id=wpK7URqbAJnWB90W">Beijing</a> and <a href="http://www.flickr.com/map?place_id=YeHeQIybA5mpLWFM">Tehran</a> where, I&#8217;m told, the OSM community has added twice as much data since we first started showing (OSM) maps a month ago!</p>
<p>If it sometimes seems like we&#8217;re doing all of this in a bit of an ad hoc fashion that&#8217;s because we (mostly) are. How and when and where are all details we need to work out going forward but, in the meantime, we have map tiles where there were none before so it can&#8217;t be all bad.</p>
<p>Finally, because the actual decision to attend the conference was so last minute I did not get the memo to all presenters to include a funny picture of <a href="http://www.openstreetmap.org/user/SteveC">SteveC</a> (one of the original founders of Open Street Maps) in their slides.</p>
<p>To make up for that omission, I leave you now with the one-and-only <a href="http://www.asklater.com/steve/">Steve Coast</a>.</p>
<div>
		<a href="http://www.flickr.com/photos/95939612@N00/2095372820/" title="Steve *loves* Yahoo by Andy Hume, on Flickr"><img src="http://farm3.static.flickr.com/2412/2095372820_84028a93bc.jpg" width="500" height="375" alt="Steve *loves* Yahoo" style="border:1px dotted #ccc;padding:10px;margin-bottom:10px;"/></a><br />
		</p>
<div style="text-align:right;font-size:small;">photo by <a href="http://www.flickr.com/photos/95939612@N00/">Andy Hume</a></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/07/22/horseyes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matthias Gansrigler: On flickery, and making your API apps fly</title>
		<link>http://code.flickr.com/blog/2009/07/16/matthias-gansrigler-on-flickery-and-making-your-api-apps-fly/</link>
		<comments>http://code.flickr.com/blog/2009/07/16/matthias-gansrigler-on-flickery-and-making-your-api-apps-fly/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 22:27:52 +0000</pubDate>
		<dc:creator>kellan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=1005</guid>
		<description><![CDATA[We meant to take a short break in our developer interview series.  Well we ended up taking a very long short break.  Sorry about that.  Thankfully we&#8217;re coming back with a really great interview from the developer behind flickery, a full featured, and fast Flickr desktop client.  And he is talking [...]]]></description>
			<content:encoded><![CDATA[<p>We meant to take a short break in our developer interview series.  Well we ended up taking a <strong>very long</strong> short break.  Sorry about that.  Thankfully we&#8217;re coming back with a really great interview from the developer behind <a href="http://www.flickeryapp.com/">flickery</a>, a full featured, and fast Flickr desktop client.  And he is talking about super important topics: optimization, performance and caching.</p>
<p>Part detective story, part day-in-the-life-of-a-working developer, Matthias&#8217; nuts and bolts discussion of how to take full advantage of the Flickr API without slowing down your app is a must read.</p>
<p><a href="http://www.flickr.com/photos/oddysseey/sets/72157613343890750/"><img src="http://farm3.static.flickr.com/2548/3727201179_765417a744.jpg" border="0"></a></p>
<p>Hello there.</p>
<p>My name is <a href="http://www.flickr.com/photos/oddysseey/">Matthias Gansrigler</a>, I&#8217;m the founder of <a href="http://www.eternalstorms.at/">Eternal Storms Software</a>, responsible for donationware like GimmeSomeTune or PresentYourApps for Mac.</p>
<p>My newest creation and the reason I&#8217;m writing here, however &#8211; and first shareware application, might I add &#8211; is <a href="http://www.flickeryapp.com/">flickery</a>, a Flickr desktop client for Mac OS X 10.5 Leopard!</p>
<p>With <a href="http://www.flickeryapp.com/">flickery</a> you can easily upload your photos to Flickr, manage your sets and favorites, view your contacts&#8217; photos, search for photos in Flickr&#8217;s data, comment, view the most &#8220;interesting&#8221; pictures and much more. All in one tiny, yet powerful application.</p>
<p>I was kindly invited by the great guys behind Flickr to write about my experiences optimizing calls to the Flickr API.</p>
<p>But first, a little background story:</p>
<p>I was born in 1986 in&#8230; well, uhm, that&#8217;s maybe a little too far back. Let&#8217;s start in 2008. That&#8217;s more like it.</p>
<p>In February 2008, I began flirting with the idea of writing a full-featured desktop client for Flickr for Mac. But really, I just wanted to toy around with the <a href="http://flickr.com/services/api">Flickr API</a> since I&#8217;d seen so many web-applications making use of it and had heard good things of the API in general.</p>
<h2>&#8220;like a kid in a toys-store&#8221;</h2>
<p>Soon thereafter, I had tremendous results in the shortest amount of time. I felt like a kid in a toys-store &#8211; completely overwhelmed (and way in over my head, as it later turned out). I did not worry very much about how many calls I made to the API. My main interest was in getting a product ready. So it took me about three months (until mid-May 2008) to ship my first public beta.  I had implemented lots of things, like commenting on photos, adding photos to favorites, different views of photos, etc. It was a great first public beta, feature-wise.  But under the hood, it wasn&#8217;t that great. It was sluggish, slow, leaked tons of memory and made an awful lot of calls to the Flickr API. And when I say an awful lot, I mean a hell of a lot. Flickr&#8217;s servers were smoking (well, I doubt that, because I think then I would have heard from their lawyers).</p>
<h2>&#8220;30 QPS&#8221;</h2>
<p>With just about 1,000 registered users, flickery made more than 30 QPS (queries per second) to the Flickr API. 30 QPS. Can you imagine? How come, you might ask. Just try it, it&#8217;s easy (no, seriously, don&#8217;t!). I made calls for everything. I even made calls in advance. But let me elaborate.</p>
<p>Take flickery&#8217;s main screen. You can see 30 items in the thumbnail view. For every item in that list, I made a <code>getInfo()</code> and <code>getSizes()</code> call for later use (should the user want to view the photo bigger or view it&#8217;s description). Additionally, whenever a user selected one of the items, flickery would call out to the API again asking if it was allowed to download that photo. So that&#8217;s 1 call for the 30 photos, 30 calls for <code>getInfo</code> and 30 calls for <code>getSizes</code>. That alone is <em>61 calls</em> for basically ONE user-interaction (clicking on Newest). That&#8217;s not right. Should a user go through the entire list and select every item, that&#8217;s 30 more calls (totalling at 91). That&#8217;s even not righter.</p>
<p>If you want to get your API key shut down (which is what happened to that first public beta of flickery) &#8211; that&#8217;s absolutely the way to do it. No doubt about it.</p>
<p>Obviously, the really hard work started here &#8211; retaining the same feature-set, the same interface and the same comfort, yet making far, far less calls to the API. What also starts here is the really technical gibberish. So get out your nerd-english dictionaries and let&#8217;s get to it.</p>
<h2>&#8220;really hard work&#8221;</h2>
<p>I basically had all the features in there for a 1.0 release. But I couldn&#8217;t release it until it made a proper amount of calls to the API. So where I started, obviously, was at removing the &#8220;in-advance&#8221; calls to the API, like <a href="http://www.flickr.com/services/api/flickr.photos.getInfo.html">getInfo</a> and <a href="http://www.flickr.com/services/api/flickr.photos.getSizes.html">getSizes</a>. They just don&#8217;t get called in advance anymore, only on demand. So if a user selects a photo and clicks on &#8220;More info&#8221;, then the getInfo call is made. No sooner. I chose a different approach for <code>getSizes</code>, which I eliminated entirely (except when downloading a photo). The photo gets loaded in thumbnail-size (which is always there). A double click on the photo loads the medium sized image, which is always there, as well. When you want to view the photo in fullscreen mode, there&#8217;s two possibilities. If the call to the API returned a o_dims attribute, we load the original size (since that&#8217;s returned in the one call to the API retrieving all the 30 photos). Should there be no such attribute, I just load the medium size and am done with it. So for viewing photos, whatever size, there&#8217;s no extra calls made. So from 61 calls, we trimmed that down to 1 call to retrieve the 30 photos. Also, when an item is selected, there is no call made anymore. Only when the user selects &#8220;Download&#8221;, flickery asks if it is allowed to download that photo and if so, makes a <code>getSizes</code> call to download the largest possible version.</p>
<h2>&#8220;retrieving the photolist&#8221;</h2>
<p>Now, for retrieving the photolist. In the first public beta, I made one call for every 30 images I wanted to retrieve. That&#8217;s kind of logical. However, that would mean that we would have to make 16 calls to view 480 items. We can trim that down. Flickr allows you to retrieve 500 items at once with each call. So that&#8217;s basically what I did. I wrote my own system that internally loaded 480 items, but only returned the 30 items of the page that were requested in the interface. So for viewing 480 photos, we now only need one call, which is like one 16th of the calls we made before. It has a little downside, though &#8211; the initial call takes a little longer for results to come back (since it is fetching more items at once from Flickr&#8217;s servers). But on the other hand, once those 480 items are retrieved, subsequent paging through those 16 pages is instant.</p>
<p>Adding photos to favorites, sets and groups was the next step. Let&#8217;s stay at favorites, because basically, it&#8217;s the same procedure for all three of them. In the first public beta, a user could add one photo to their favorites over and over again, and flickery would dutifully send that call to the API. Of course, completely unnecessarily. So I just cached what was added to the favorites and just checked if we already added the photo to the favorites, which, as it turned out, saved lots of highly unnecessary calls.</p>
<p>I also took the liberty to implement some of Flickr&#8217;s rules right into flickery, meaning the following: If you&#8217;re not the admin of a group, you can only remove your own photos from it. If you&#8217;re the admin, you can remove all of them. So instead of flickery making a call to the API when the user wants to remove a photo and they&#8217;re not the admin, the application itself tells them they can&#8217;t do that. A lot of calls are saved this way.</p>
<h2>&#8220;caching&#8221;</h2>
<p>Another big step in making less calls to the API was caching, naturally. In the first public beta, nothing except the frob for talking to the API was saved over application launches. So every time the user launched the application, the authorization token, the Newest photos, the user&#8217;s sets and contacts were loaded. All that has changed and they are now saved over restarts for different time intervals. Newest photos for one hour, sets and contacts forever (albeit, the user can reload photosets groups and contacts (once an hour) should they ever be out of sync). The same goes for the contents of photosets, groups, favorites and own photos. To remove some other calls, if there&#8217;s a cache already in place for, say, a photoset, I don&#8217;t delete that cache should a new photo be added to it, but update it. So, the call is made to the API to add the photo to the set, obviously, but to then view the set (with the newly added photo in it), I don&#8217;t reload the photoset but just update the existing cache. Another example here is comments. When adding your own comment to a photo, flickery doesn&#8217;t reload the entire comment-list, but just adds the new comment to the already existing cache.</p>
<h2>&#8220;extras&#8221;</h2>
<p>Specifying options in the &#8220;extras&#8221; parameter can save you lots of calls as well. (<i>e.d. see our post on <a href="http://code.flickr.com/blog/2008/08/19/standard-photos-response-apis-for-civilized-age/">the standard photos response for more on extras</a></i>) Instead of having to make another call to retrieve certain information about an item, you can have all kinds of information returned in the initial response. Say, you want the owner&#8217;s name of items. Instead of having to call flickr.photos.getInfo on every item, you just specify the owner_name option in the &#8220;extras&#8221; parameter and immediately have the owner&#8217;s name for every item of your query. This is really handy and saves lots of time for the users and lots of calls for you.</p>
<p>As for the Flickr API &#8211; it&#8217;s really great and easy to use. However, there are some smaller things I&#8217;d love to see:<br />
Being able to specify more than 1 photo<em>id for adding to / removing from favorites, photosets and groups &#8211; resulting in far less calls to the API, the upload response returning not only the photo</em>id for the uploaded image, but also the farm and server, official support for collections, adding / removing contacts, support for retrieving videos, maybe even some calls for flickrMail. Some more &#8220;extras&#8221; options would be great, too, like can_download, for example, which is currently only retrievable through <a href="http://www.flickr.com/services/api/flickr.photos.getInfo.html">flickr.photos.getInfo</a>.</p>
<p>Other than that, the Flickr API let&#8217;s you really do everything you could imagine. There&#8217;s almost no restriction to what you can do with it!</p>
<p>Closing, I&#8217;d just like to thank the wizards at Flickr for the opportunity to write about optimizing here and working so closely with me on flickery. Here&#8217;s to more great applications using the Flickr API!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/07/16/matthias-gansrigler-on-flickery-and-making-your-api-apps-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
