CINXE.COM

December | 2011 | code.flickr.com

<!DOCTYPE html> <!--[if IE 6]> <html id="ie6" lang="en"> <![endif]--> <!--[if IE 7]> <html id="ie7" lang="en"> <![endif]--> <!--[if IE 8]> <html id="ie8" lang="en"> <![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--> <html lang="en"> <!--<![endif]--> <!-- generated 143 seconds ago generated in 0.241 seconds served from batcache in 0.002 seconds expires in 157 seconds --> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://code.flickr.net:80/2011/12/","20130503115111","https://web.archive.org/","web","/_static/", "1367581871"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width"/> <title>December | 2011 | code.flickr.com</title> <link rel="profile" href="http://gmpg.org/xfn/11"/> <link rel="stylesheet" type="text/css" media="all" href="https://web.archive.org/web/20130503115111cs_/http://s2.wp.com/wp-content/themes/vip/flickr-code/style.css?m=1345671377g"/> <link rel="pingback" href="http://code.flickr.net/xmlrpc.php"/> <!--[if lt IE 9]> <script src="http://s2.wp.com/wp-content/themes/pub/twentyeleven/js/html5.js?m=1354160568g" type="text/javascript"></script> <![endif]--> <script src="https://web.archive.org/web/20130503115111js_/http://r-login.wordpress.com/remote-login.php?action=js&amp;host=code.flickr.net&amp;id=39034126&amp;t=1367581728&amp;back=code.flickr.net%2F2011%2F12%2F" type="text/javascript"></script> <script type="text/javascript"> /* <![CDATA[ */ if ( 'function' === typeof WPRemoteLogin ) { document.cookie = "wordpress_test_cookie=test; path=/"; if ( document.cookie.match( /(;|^)\s*wordpress_test_cookie\=/ ) ) { WPRemoteLogin(); } } /* ]]> */ </script> <link rel="alternate" type="application/rss+xml" title="code.flickr.com » Feed" href="https://web.archive.org/web/20130503115111/http://code.flickr.net/feed/"/> <link rel="alternate" type="application/rss+xml" title="code.flickr.com » Comments Feed" href="https://web.archive.org/web/20130503115111/http://code.flickr.net/comments/feed/"/> <script type="text/javascript"> /* <![CDATA[ */ function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}} /* ]]> */ </script> <link rel="stylesheet" id="all-css-0" href="https://web.archive.org/web/20130503115111cs_/http://s1.wp.com/_static/??-eJydjkkOwjAMRS9EsJhadYE4SxrcJI2TWI3bqrenILFiEGJlff+nZ8PMyuQkmATiqJhG61MB8gEL9CisTVCPtDWlbOA9zrmI6kj7AYoshC+sOIyrkMcWZF4XCxJOmL7Tk2foyJswrM0V/1GrmU2Ov77u9OCTfc5Pl9wRLOVW0x24xPPuUNX7qm6aU38DFuV8+Q==" type="text/css" media="all"/> <script type="text/javascript" src="https://web.archive.org/web/20130503115111js_/http://s1.wp.com/_static/??-eJyFzUEKgCAQBdALZSKRu+gsYkOMpZkzFXX6CmoRRMHAX/zHH7lEgcH2UwMk3XHjBGm9IneUyS8gPLbJMNzQDoEh8OniQOyByLRv7fMNhhlh+WUOOBrbiQSE27la+0oVWpeqULp0O6cpS2E="></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://flickrcode.wordpress.com/xmlrpc.php?rsd"/> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://flickrcode.wordpress.com/wp-includes/wlwmanifest.xml"/> <meta name="generator" content="WordPress.com"/> <link rel="shortcut icon" type="image/x-icon" href="https://web.archive.org/web/20130503115111im_/http://1.gravatar.com/blavatar/341946154e8a7e5497473810e7ef560c?s=16" sizes="16x16"/> <link rel="icon" type="image/x-icon" href="https://web.archive.org/web/20130503115111im_/http://1.gravatar.com/blavatar/341946154e8a7e5497473810e7ef560c?s=16" sizes="16x16"/> <link rel="apple-touch-icon-precomposed" href="https://web.archive.org/web/20130503115111im_/http://0.gravatar.com/blavatar/8b1d73fba9c0d02a3e78929d8cecfd82?s=114"/> <link rel="openid.server" href="http://flickrcode.wordpress.com/?openidserver=1"/> <link rel="openid.delegate" href="http://flickrcode.wordpress.com/"/> <link rel="search" type="application/opensearchdescription+xml" href="https://web.archive.org/web/20130503115111/http://code.flickr.net/osd.xml" title="code.flickr.com"/> <link rel="search" type="application/opensearchdescription+xml" href="https://web.archive.org/web/20130503115111/http://wordpress.com/opensearch.xml" title="WordPress.com"/> <style> /* <![CDATA[ */ /* Block: reblog */ .reblog-from img { margin: 0 10px 0 0; vertical-align: middle; padding: 0; border: 0; } .reblogger-note img.avatar { float: left; padding: 0; border: 0; } .reblogger-note-content { margin: 0 0 20px; } .reblog-post .wpcom-enhanced-excerpt-content { border-left: 3px solid #eee; padding-left: 15px; } .reblog-post ul.thumb-list { display: block; list-style: none; margin: 2px 0; padding: 0; clear: both; } .reblog-post ul.thumb-list li { display: inline; margin: 0; padding: 0 1px; border: 0; } .reblog-post ul.thumb-list li a { margin: 0; padding: 0; border: 0; } .reblog-post ul.thumb-list li img { margin: 0; padding: 0; border: 0; } .reblog-post .wpcom-enhanced-excerpt { clear: both; } .reblog-post .wpcom-enhanced-excerpt address, .reblog-post .wpcom-enhanced-excerpt li, .reblog-post .wpcom-enhanced-excerpt h1, .reblog-post .wpcom-enhanced-excerpt h2, .reblog-post .wpcom-enhanced-excerpt h3, .reblog-post .wpcom-enhanced-excerpt h4, .reblog-post .wpcom-enhanced-excerpt h5, .reblog-post .wpcom-enhanced-excerpt h6, .reblog-post .wpcom-enhanced-excerpt p { font-size: 100% !important; } .reblog-post .wpcom-enhanced-excerpt blockquote, .reblog-post .wpcom-enhanced-excerpt pre, .reblog-post .wpcom-enhanced-excerpt code, .reblog-post .wpcom-enhanced-excerpt q { font-size: 98% !important; } /* ]]> */ </style> <meta name="application-name" content="code.flickr.com"/><meta name="msapplication-window" content="width=device-width;height=device-height"/><meta name="msapplication-task" content="name=Subscribe;action-uri=http://code.flickr.net/feed/;icon-uri=http://1.gravatar.com/blavatar/341946154e8a7e5497473810e7ef560c?s=16"/> <style type="text/css" id="twentyeleven-header-css"> #site-title, #site-description { position: absolute !important; clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); } </style> <style id="syntaxhighlighteranchor"></style> <link rel="stylesheet" id="custom-css-css" type="text/css" href="https://web.archive.org/web/20130503115111cs_/http://s1.wp.com/?custom-css=1&amp;csblog=2DMyG&amp;cscache=6&amp;csrev=103"/> </head> <body class="archive date typekit-enabled two-column right-sidebar highlander-enabled highlander-light"> <div id="page" class="hfeed"> <header id="branding" role="banner"> <hgroup> <h1 id="site-title"><span><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/" title="code.flickr.com" rel="home">code.flickr.com</a></span></h1> <h2 id="site-description"></h2> </hgroup> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/"> <img src="https://web.archive.org/web/20130503115111im_/http://flickrcode.files.wordpress.com/2012/09/code-flickr-com-drawn-header-grey-large.png" width="1000" height="157" alt=""/> </a> <div class="only-search with-image"> <form method="get" id="searchform" action="https://web.archive.org/web/20130503115111/http://code.flickr.net/"> <label for="s" class="assistive-text">Search</label> <input type="text" class="field" name="s" id="s" placeholder="Search"/> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search"/> </form> </div> <nav id="access" role="navigation"> <h3 class="assistive-text">Main menu</h3> <div class="skip-link"><a class="assistive-text" href="#content" title="Skip to primary content">Skip to primary content</a></div> <div class="skip-link"><a class="assistive-text" href="#secondary" title="Skip to secondary content">Skip to secondary content</a></div> <div class="menu-menu-container"><ul id="menu-menu" class="menu"><li id="menu-item-2084" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2084"><a href="https://web.archive.org/web/20130503115111/http://www.flickr.com/">Flickr</a></li> <li id="menu-item-2085" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2085"><a href="https://web.archive.org/web/20130503115111/http://blog.flickr.net/">Flickr Blog</a></li> <li id="menu-item-2250" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2250"><a href="https://web.archive.org/web/20130503115111/http://twitter.com/flickr">@flickr</a></li> <li id="menu-item-2086" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2086"><a href="https://web.archive.org/web/20130503115111/http://twitter.com/flickrapi">@flickrapi</a></li> <li id="menu-item-2087" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2087"><a href="https://web.archive.org/web/20130503115111/http://developer.flickr.com/">Developer Guidelines</a></li> <li id="menu-item-2088" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2088"><a href="https://web.archive.org/web/20130503115111/http://www.flickr.com/services/api/">API</a></li> <li id="menu-item-2089" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2089"><a href="https://web.archive.org/web/20130503115111/http://www.flickr.com/jobs/">Jobs</a></li> </ul></div> </nav><!-- #access --> </header><!-- #branding --> <div id="main"> <section id="primary"> <div id="content" role="main"> <header class="page-header"> <h1 class="page-title"> Monthly Archives: <span>December 2011</span> </h1> </header> <article id="post-1727" class="post-1727 post type-post status-publish format-standard hentry category-uncategorized"> <header class="entry-header"> <h1 class="entry-title"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/12/16/pleiades-a-guest-post/" rel="bookmark">Pleiades: A guest&nbsp;post</a></h1> <div class="entry-meta"> <span class="sep">Posted on </span><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/12/16/pleiades-a-guest-post/" title="10:41 pm" rel="bookmark"><time class="entry-date" datetime="2011-12-16T22:41:45+00:00">December 16, 2011</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="https://web.archive.org/web/20130503115111/http://code.flickr.net/author/waferbaby/" title="View all posts by Daniel Bogan" rel="author">Daniel Bogan</a></span></span> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <p>I recently asked our friend Sean from <a href="https://web.archive.org/web/20130503115111/http://pleiades.stoa.org/">Pleiades</a> (which I will *never* be able to spell correctly) to write up a lil&#8217; guest post on how we did something cool with Flickr machine tags and ancient sites of the world &#8211; and here it is!</p> <hr/> <div class="section" id="intro"> <h1>Intro</h1> <p>I&#8217;m Sean Gillies, a programmer at <a class="reference external" href="https://web.archive.org/web/20130503115111/http://isaw.nyu.edu/">ISAW</a>, the Institute for the Study of the<br/> Ancient World at New York University. I&#8217;m part of the Digital Programs team,<br/> which develops applications for researchers of ancient civilizations. Most of<br/> my work is on a gazetteer and graph of ancient places called <a class="reference external" href="https://web.archive.org/web/20130503115111/http://pleiades.stoa.org/">Pleiades</a>. It<br/> identifies and describes over 34,000 places in antiquity and makes them<br/> editable on the web. A grant from the U.S. National Endowment for the<br/> Humanities (<a class="reference external" href="https://web.archive.org/web/20130503115111/http://www.neh.gov/">NEH</a>) running through April 2013 is allowing Pleiades to bulk up on<br/> ancient world places and develop features that can support ambitious<br/> applications like the digital classics network called <a class="reference external" href="https://web.archive.org/web/20130503115111/http://pelagios-project.blogspot.com/">Pelagios</a>.</p> </div> <div class="section" id="background"> <h1>Background</h1> <p>In August of 2010, Dan Pett and Ryan Baumann suggested that we coin Flickr<br/> <a class="reference external" href="https://web.archive.org/web/20130503115111/http://flickr.com/groups/api/discuss/72157594497877875">machine tags</a> in a &quot;pleiades&quot; namespace so that Flickr users could assert<br/> connections between their photos and places in antiquity and search for photos<br/> based on these connections. Ryan is a programmer for the University of<br/> Kentucky&#8217;s <a class="reference external" href="https://web.archive.org/web/20130503115111/http://www.vis.uky.edu/index.php">Center for Visualization and Virtual Environments</a> and<br/> collaborates with NYU and ISAW on <a class="reference external" href="https://web.archive.org/web/20130503115111/http://papyri.info/">Papyri.info</a>. Dan works at the British<br/> Museum and is the developer of the Portable Antiquities Scheme&#8217;s website:<br/> <a class="reference external" href="https://web.archive.org/web/20130503115111/http://finds.org.uk/">finds.org.uk</a>. At about the same time, ISAW had launched its <a class="reference external" href="https://web.archive.org/web/20130503115111/http://flickr.com/photos/isawnyu/collections/">Flickr-hosted</a><br/> <a class="reference external" href="https://web.archive.org/web/20130503115111/http://isaw.nyu.edu/ancient-world-image-bank">Ancient World Image Bank</a> and was looking for ways to exploit these images,<br/> many of which were on the web for the first time. AWIB lead Tom Elliott,<br/> ISAW&#8217;s Associate Director for Digital Programs, and AWIB Managing Editor Nate<br/> Nagy started machine tagging AWIB photos in December 2010. When Dan wrote &quot;Now<br/> to get flickr&#8217;s system to link back a la openplaques etc.&quot; in an email, we all<br/> agreed that would be quite cool, but weren&#8217;t really sure how to make it happen.</p> <p>As AWIB picked up steam this year, Tom blogged about the machine tags. His<br/> <a class="reference external" href="https://web.archive.org/web/20130503115111/http://horothesia.blogspot.com/2011/09/feeds-of-flickr-photos-depicting.html">post</a> was read by <a class="reference external" href="https://web.archive.org/web/20130503115111/http://www.flickr.com/people/dandiffendale/">Dan Diffendale</a>, who began tagging his photos of cultural<br/> objects to indicate their places of origin or discovery. In email, Tom and Dan<br/> agreed that it would be useful to distinguish between findspot and place of<br/> origin in photos of objects and to distinguish these from photos depicting the<br/> physical site of an ancient place. They resolved to use some of the predicates<br/> from the <a class="reference external" href="https://web.archive.org/web/20130503115111/http://atlantides.org/trac/concordia/wiki">Concordia</a> project, a collaboration between ISAW and the Center for<br/> Computing in the Humanities at King&#8217;s College, London (now the Arts and<br/> Humanities Research Institute), jointly funded by the NEH and <a class="reference external" href="https://web.archive.org/web/20130503115111/http://www.jisc.ac.uk/">JISC</a>. For<br/> findspots, <tt class="docutils literal">pleiades:findspot=PID</tt> (where PID is the short key of a Pleiades<br/> place) would be used. Place of origin would be tagged by <tt class="docutils literal">pleiades:origin=PID</tt>.<br/> A photo depicting a place would be tagged <tt class="docutils literal">pleiades:depicts=PID</tt>. The original<br/> <tt class="docutils literal">pleiades:place=PID</tt> tag would be for a geographic-historic but otherwise<br/> unspecified relationship between a photo and a place. Concordia&#8217;s original<br/> approach was not quite RDF forced into Atom links, and was easily adapted to<br/> Flickr&#8217;s &quot;<a class="reference external" href="https://web.archive.org/web/20130503115111/http://geobloggers.com/2007/01/24/offtopic-ish-flickr-ramps-up-triple-tag-support/">not quite RDF forced into tags</a>&quot; infrastructure.</p> <p>I heard from <a class="reference external" href="https://web.archive.org/web/20130503115111/http://www.aaronstraupcope.com/">Aaron Straup Cope</a> at State of the Map (the OpenStreetMap annual<br/> meeting) in Denver that he&#8217;d seen Tom&#8217;s blog post and, soon after, that it was<br/> on the radar at Flickr. OpenStreetMap machine tags (among some others) get<br/> <a class="reference external" href="https://web.archive.org/web/20130503115111/http://code.flickr.com/blog/2009/07/06/extraextraextra/">extra love</a> at Flickr, meaning that Flickr uses the machine tag as a key to<br/> external data shown on or used by photo pages. In the OSM case, that means<br/> structured data about ways <a class="reference external" href="https://web.archive.org/web/20130503115111/http://code.flickr.com/blog/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/">ways and nodes</a>, structured data that surfaces on<br/> photo pages like <a class="reference external" href="https://web.archive.org/web/20130503115111/http://flickr.com/photos/frankieroberto/3396068360/">http://flickr.com/photos/frankieroberto/3396068360/</a> as &quot;St<br/> George&#8217;s House is a building in OpenStreetMap.&quot; Outside Flickr, OSM<br/> users can query the Flickr API for photos related to any particular way or<br/> node, enabling street views (for example) not as a product, but as an<br/> grassroots project. Two weeks later, to our delight, Daniel Bogan contacted Tom<br/> about giving Pleiades machine tags the same kind of treatment. He and Tom<br/> quickly came up with good short labels for our predicates and support for the<br/> Pleiades machine tags went live on Flickr in the middle of November.</p> </div> <div class="section" id="the-pleiades-machine-tags"> <h1>The Pleiades machine tags</h1> <p>Pleiades mainly covers the Greek and Roman world from about 900 BC &#8211; 600 AD. It<br/> is expanding somewhat into older Egyptian, Near East and Celtic places, and<br/> more recent Byzantine and early Medieval Europe places. Every place has a URL<br/> of the form <tt class="docutils literal"><span class="pre"><a href="https://web.archive.org/web/20130503115111/http://pleiades.stoa.org/places/$PID" rel="nofollow">http://pleiades.stoa.org/places/$PID</a></span></tt> and it is these <tt class="docutils literal">PID</tt><br/> values that go in machine tags. It&#8217;s quite easy to find Pleiades places through<br/> the major search engines as well as through the site&#8217;s own <a class="reference external" href="https://web.archive.org/web/20130503115111/http://pleiades.stoa.org/search">search form</a>.</p> <p>The semantics of the tags are as follows:</p> <dl class="docutils"> <dt><strong>pleiades:depicts=PID</strong></dt> <dd>The <tt class="docutils literal">PID</tt> place (or what remains) is depicted in the photo</dd> <dt><strong>pleiades:findspot=PID</strong></dt> <dd>The <tt class="docutils literal">PID</tt> place is where a photo subject was found</dd> <dt><strong>pleiades:origin=PID</strong></dt> <dd>The <tt class="docutils literal">PID</tt> place is where a photo subject was produced</dd> <dt><strong>pleiades:where=PID</strong></dt> <dd>The <tt class="docutils literal">PID</tt> place is the location of the photo subject</dd> <dt><strong>pleiades:place=PID</strong></dt> <dd>The <tt class="docutils literal">PID</tt> place is otherwise related to the photo or its subject</dd> </dl> <p>At Pleiades, our immediate use for the machine tags is giving our ancient<br/> places excellent portrait photos.</p> </div> <div class="section" id="on-the-flickr-side"> <h1>On the Flickr Side</h1> <p>Here&#8217;s how it works on the Flickr side, as seen by a user. When you coin a new,<br/> never before used on Flickr machine tag like <tt class="docutils literal">pleiades:depicts=440947682</tt> (as<br/> seen on AWIB&#8217;s photo <a class="reference external" href="https://web.archive.org/web/20130503115111/http://flickr.com/photos/isawnyu/6437728435/">Tombs at El Kab</a> by Iris Fernandez), Flickr fetches the<br/> JSON data at <a class="reference external" href="https://web.archive.org/web/20130503115111/http://pleiades.stoa.org/places/440947682/json">http://pleiades.stoa.org/places/440947682/json</a> in which the<br/> ancient place is represented as a <a class="reference external" href="https://web.archive.org/web/20130503115111/http://geojson.org/">GeoJSON</a> feature collection. A snippet of<br/> that JSON, fetched with curl and pretty printed with python</p> <pre class="literal-block"> $ curl http://pleiades.stoa.org/places/440947682/json | python -mjson.tool </pre> <p>is shown here:</p> <pre class="literal-block"> { ... &quot;id&quot;: &quot;440947682&quot;, &quot;title&quot;: &quot;El Kab&quot;, &quot;type&quot;: &quot;FeatureCollection&quot; } </pre> <p>[Gist: <a class="reference external" href="https://web.archive.org/web/20130503115111/https://gist.github.com/1488270">https://gist.github.com/1488270</a>]</p> <p>The title is extracted and used to label a link to the Pleiades place under the<br/> photo&#8217;s &quot;Additional info&quot;.</p> <p><img alt="http://farm8.staticflickr.com/7161/6522002861_537ca823d4_b_d.jpg" src="https://web.archive.org/web/20130503115111im_/http://farm8.staticflickr.com/7161/6522002861_537ca823d4_b_d.jpg" style="width: 501px; height: 678px;"/></p> <p>Flickr is in this way a user of the <a class="reference external" href="https://web.archive.org/web/20130503115111/http://sgillies.net/blog/1101/does-pleiades-have-an-api">Pleiades not-quite-an-API</a> that I blogged<br/> about two weeks ago.</p> </div> <div class="section" id="flickr-as-external-pleiades-editor"> <h1>Flickr as external Pleiades editor</h1> <p>On the Pleiades end, we&#8217;re using the Flickr website to identify and collect<br/> openly licensed photos that will serve as portraits for our ancient places. We<br/> can&#8217;t control use of tags but would like some editorial control over images,<br/> so we&#8217;ve created a Pleiades Places group and pull portrait photos from its pool.<br/> The process goes like this:</p> <p><img alt="http://farm8.staticflickr.com/7172/6522275377_bbda2a70ac_o_d.png" src="https://web.archive.org/web/20130503115111im_/http://farm8.staticflickr.com/7172/6522275377_bbda2a70ac_o_d.png" style="width: 487px; height: 605px;"/></p> <p>We&#8217;re editing (in this one way) Pleiades pages entirely via Flickr. We get a kick<br/> out of this sort of thing at Pleiades. Not only do we love to see small pieces<br/> loosely joined in action, we also love not reinventing applications that already<br/> exist.</p> </div> <div class="section" id="watch-the-birdie"> <h1>Watch the birdie</h1> <p>This system for acquiring portraits uses two Flickr API methods:<br/> <tt class="docutils literal">flickr.photos.search</tt> and <tt class="docutils literal">flickr.groups.pools.getPhotos</tt>. The guts of it<br/> is <a class="reference external" href="https://web.archive.org/web/20130503115111/https://gist.github.com/1482469">this Python class</a>:</p> <pre class="literal-block"> class RelatedFlickrJson(BrowserView): &quot;&quot;&quot;Makes two Flickr API calls and writes the number of related photos and URLs for the most viewed related photo from the Pleiades Places group to JSON like {&quot;portrait&quot;: { &quot;url&quot;: &quot;http://flickr.com/photos/27621672&#64;N04/3734425631/in/pool-1876758&#64;N22&quot;, &quot;img&quot;: &quot;http://farm3.staticflickr.com/2474/3734425631_b15979f2cd_m.jpg&quot;, &quot;title&quot;: &quot;Pont d'Ambroix by sgillies&quot; }, &quot;related&quot;: { &quot;url&quot;: [&quot;http://www.flickr.com/photos/tags/pleiades:*=149492/&quot;], &quot;total&quot;: 2 }} for use in the Flickr Photos portlet on every Pleiades place page. &quot;&quot;&quot; def __call__(self, **kw): data = {} pid = self.context.getId() # local id like &quot;149492&quot; # Count of related photos tag = &quot;pleiades:*=&quot; + pid h = httplib2.Http() q = dict( method=&quot;flickr.photos.search&quot;, api_key=FLICKR_API_KEY, machine_tags=&quot;pleiades:*=%s&quot; % self.context.getId(), format=&quot;json&quot;, nojsoncallback=1 ) resp, content = h.request(FLICKR_API_ENDPOINT + &quot;?&quot; + urlencode(q), &quot;GET&quot;) if resp['status'] == &quot;200&quot;: total = 0 photos = simplejson.loads(content).get('photos') if photos: total = int(photos['total']) data['related'] = dict(total=total, url=FLICKR_TAGS_BASE + tag) # Get portrait photo from group pool tag = &quot;pleiades:depicts=&quot; + pid h = httplib2.Http() q = dict( method=&quot;flickr.groups.pools.getPhotos&quot;, api_key=FLICKR_API_KEY, group_id=PLEIADES_PLACES_ID, tags=tag, extras=&quot;views&quot;, format=&quot;json&quot;, nojsoncallback=1 ) resp, content = h.request(FLICKR_API_ENDPOINT + &quot;?&quot; + urlencode(q), &quot;GET&quot;) if resp['status'] == '200': total = 0 photos = simplejson.loads(content).get('photos') if photos: total = int(photos['total']) if total &lt; 1: data['portrait'] = None else: # Sort found photos by number of views, descending most_viewed = sorted( photos['photo'], key=lambda p: p['views'], reverse=True ) photo = most_viewed[0] title = photo['title'] + &quot; by &quot; + photo['ownername'] data['portrait'] = dict( title=title, img=IMG_TMPL % photo, url=PAGE_TMPL % photo ) self.request.response.setStatus(200) self.request.response.setHeader('Content-Type', 'application/json') return simplejson.dumps(data) </pre> <p>[Gist: <a class="reference external" href="https://web.archive.org/web/20130503115111/https://gist.github.com/1482469">https://gist.github.com/1482469</a>]</p> <p>The same thing could be done with urllib, of course, but I&#8217;m a fan of httplib2.<br/> Javascript on Pleiades place pages asynchronously fetches data from this view<br/> and updates the DOM. The end result is a &quot;Flickr Photos&quot; section at the bottom<br/> right of every place page that looks (when we have a portrait) like this:</p> <p><img alt="http://farm8.staticflickr.com/7012/6522002865_350997d652_o_d.jpg" src="https://web.archive.org/web/20130503115111im_/http://farm8.staticflickr.com/7012/6522002865_350997d652_o_d.jpg" style="width: 599px; height: 529px;"/></p> <p>We&#8217;re excited about the extra love for Pleiades places and can clearly see it<br/> working. The number of places tagged <tt class="docutils literal"><span class="pre">pleiades:*=</span></tt> is rising quickly – up 50%<br/> just this week – and we&#8217;ve gained new portraits for many of our well-known<br/> places. I think it will be interesting to see what developers at Flickr, ISAW,<br/> or museums make of the <tt class="docutils literal">pleiades:findspot=</tt> and <tt class="docutils literal">pleiades:origin=</tt> tags.</p> </div> <div class="section" id="thanks"> <h1>Thanks</h1> <p>We&#8217;re grateful to Flickr and Daniel Bogan for the extra love and opportunity to<br/> blog about it. Work on Pleiades is supported by the NEH and ISAW. Our machine tag<br/> predicates come from a NEH-JISC project – still bearing fruit several years later.</p> </div> <div id="jp-post-flair" class="sharedaddy sd-like-enabled sd-sharing-enabled"></div> </div><!-- .entry-content --> <footer class="entry-meta"> <span class="cat-links"> <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a> </span> </footer><!-- .entry-meta --> </article><!-- #post-1727 --> </div><!-- #content --> </section><!-- #primary --> <div id="secondary" class="widget-area" role="complementary"> <aside id="search-2" class="widget widget_search"> <form method="get" id="searchform" action="https://web.archive.org/web/20130503115111/http://code.flickr.net/"> <label for="s" class="assistive-text">Search</label> <input type="text" class="field" name="s" id="s" placeholder="Search"/> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search"/> </form> </aside> <aside id="recent-posts-2" class="widget widget_recent_entries"> <h3 class="widget-title">Recent Posts</h3> <ul> <li> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2013/03/26/using-redis-as-a-secondary-index-for-mysql/" title="Using Redis as a Secondary Index for MySQL">Using Redis as a Secondary Index for&nbsp;MySQL</a> </li> <li> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/12/21/redis-global-locks-redux/" title="Redis Global Locks Redux">Redis Global Locks&nbsp;Redux</a> </li> <li> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/12/12/highly-available-real-time-notifications/" title="Highly Available Real Time Push Notifications and You">Highly Available Real Time Push Notifications and&nbsp;You</a> </li> <li> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/12/10/drag-n-drop/" title="Avoiding Dragons: A Practical Guide to Drag ’n’ Drop">Avoiding Dragons: A Practical Guide to Drag&nbsp;’n’&nbsp;Drop</a> </li> <li> <a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/10/26/flickr-at-sf-web-performance/" title="Flickr at SF Web Performance">Flickr at SF Web&nbsp;Performance</a> </li> </ul> </aside><aside id="archives-2" class="widget widget_archive"><h3 class="widget-title">Archives</h3> <ul> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2013/03/" title="March 2013">March 2013</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/12/" title="December 2012">December 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/10/" title="October 2012">October 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/07/" title="July 2012">July 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/06/" title="June 2012">June 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/05/" title="May 2012">May 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/04/" title="April 2012">April 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/02/" title="February 2012">February 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2012/01/" title="January 2012">January 2012</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/12/" title="December 2011">December 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/10/" title="October 2011">October 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/09/" title="September 2011">September 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/08/" title="August 2011">August 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/07/" title="July 2011">July 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/06/" title="June 2011">June 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/03/" title="March 2011">March 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/02/" title="February 2011">February 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2011/01/" title="January 2011">January 2011</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/11/" title="November 2010">November 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/10/" title="October 2010">October 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/09/" title="September 2010">September 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/08/" title="August 2010">August 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/07/" title="July 2010">July 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/05/" title="May 2010">May 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/04/" title="April 2010">April 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/03/" title="March 2010">March 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/02/" title="February 2010">February 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2010/01/" title="January 2010">January 2010</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/12/" title="December 2009">December 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/11/" title="November 2009">November 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/10/" title="October 2009">October 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/09/" title="September 2009">September 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/07/" title="July 2009">July 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/06/" title="June 2009">June 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/05/" title="May 2009">May 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/04/" title="April 2009">April 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/03/" title="March 2009">March 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/02/" title="February 2009">February 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2009/01/" title="January 2009">January 2009</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/12/" title="December 2008">December 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/11/" title="November 2008">November 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/10/" title="October 2008">October 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/09/" title="September 2008">September 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/08/" title="August 2008">August 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/07/" title="July 2008">July 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/06/" title="June 2008">June 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/05/" title="May 2008">May 2008</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/2008/04/" title="April 2008">April 2008</a></li> </ul> </aside><aside id="categories-2" class="widget widget_categories"><h3 class="widget-title">Categories</h3> <ul> <li class="cat-item cat-item-564792"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/change-log/" title="View all posts filed under changelog">changelog</a> </li> <li class="cat-item cat-item-5784"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/event/" title="View all posts filed under event">event</a> </li> <li class="cat-item cat-item-29160"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/geo/" title="All things geo related">geo</a> </li> <li class="cat-item cat-item-34412"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/kittens/" title="View all posts filed under kittens">kittens</a> </li> <li class="cat-item cat-item-171"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/meta/" title="View all posts filed under meta">meta</a> </li> <li class="cat-item cat-item-1"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/uncategorized/" title="View all posts filed under Uncategorized">Uncategorized</a> </li> <li class="cat-item cat-item-249276"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/uploadr/" title="View all posts filed under uploadr">uploadr</a> </li> <li class="cat-item cat-item-830560"><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/category/xulrunner/" title="View all posts filed under xulrunner">xulrunner</a> </li> </ul> </aside><aside id="meta-2" class="widget widget_meta"><h3 class="widget-title">Meta</h3> <ul> <li><a href="https://web.archive.org/web/20130503115111/http://wordpress.com/signup/?ref=wplogin">Register</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://flickrcode.wordpress.com/wp-login.php">Log in</a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/feed/" title="Syndicate this site using RSS 2.0">Entries <abbr title="Really Simple Syndication">RSS</abbr></a></li> <li><a href="https://web.archive.org/web/20130503115111/http://code.flickr.net/comments/feed/" title="The latest comments to all posts in RSS">Comments <abbr title="Really Simple Syndication">RSS</abbr></a></li> Powered by <a href="https://web.archive.org/web/20130503115111/http://vip.wordpress.com/" rel="generator nofollow" class="powered-by-wpcom">WordPress.com VIP</a> </ul> </aside> </div><!-- #secondary .widget-area --> </div><!-- #main --> <footer id="colophon" role="contentinfo"> <div id="site-generator"> Theme: Twenty Eleven <span class="sep"> | </span> Powered by <a href="https://web.archive.org/web/20130503115111/http://vip.wordpress.com/" rel="generator nofollow" class="powered-by-wpcom">WordPress.com VIP</a> </div> </footer><!-- #colophon --> </div><!-- #page --> <script type="text/javascript"> var _qevents = _qevents || [], wpcomQuantcastData = {"qacct":"p-18-mFEk4J448M","labels":",language.en,type.wpcom,vip.flickrcode"}; function wpcomQuantcastPixel( labels, options ) { var i, defaults = wpcomQuantcastData, data = { event: 'ajax' }; labels = labels || ''; options = options || {}; if ( typeof labels != 'string' ) options = labels; for ( i in defaults ) { data[i] = defaults[i]; } for ( i in options ) { data[i] = options[i]; } if ( data.labels ) { data.labels += ',' + labels; } else { data.labels = labels; } _qevents.push( data ); }; (function() {var elem = document.createElement('script');elem.src = (document.location.protocol == "https:" ? "https://web.archive.org/web/20130503115111/https://secure" : "https://web.archive.org/web/20130503115111/http://edge") + ".quantserve.com/quant.js";elem.async = true;elem.type = "text/javascript";var scpt = document.getElementsByTagName('script')[0];scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push( wpcomQuantcastData ); </script> <noscript><div style="display: none;"><img src="//web.archive.org/web/20130503115111im_/http://pixel.quantserve.com/pixel/p-18-mFEk4J448M.gif?labels=%2Clanguage.en%2Ctype.wpcom%2Cvip.flickrcode" height="1" width="1" alt=""/></div></noscript> <script type="text/javascript" src="//web.archive.org/web/20130503115111js_/http://0.gravatar.com/js/gprofiles.js?ver=201318ac"></script> <script type="text/javascript"> /* <![CDATA[ */ var WPGroHo = {"my_hash":""}; /* ]]> */ </script> <script type="text/javascript" src="https://web.archive.org/web/20130503115111js_/http://s0.wp.com/wp-content/mu-plugins/gravatar-hovercards/wpgroho.js?m=1351637563g"></script> <script>jQuery(document).ready(function($){ Gravatar.profile_cb = function( h, d ) { WPGroHo.syncProfileData( h, d ); }; Gravatar.my_hash = WPGroHo.my_hash; Gravatar.init( 'body', '#wp-admin-bar-my-account' ); });</script> <div style="display:none"> </div> <script type="text/javascript" src="https://web.archive.org/web/20130503115111js_/http://s0.wp.com/wp-content/js/devicepx.js?m=1354656609g"></script> <script type="text/javascript"> // <![CDATA[ (function() { try{ if ( window.external &&'msIsSiteMode' in window.external) { if (window.external.msIsSiteMode()) { var jl = document.createElement('script'); jl.type='text/javascript'; jl.async=true; jl.src='/wp-content/plugins/ie-sitemode/custom-jumplist.php'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jl, s); } } }catch(e){} })(); // ]]> </script><script src="https://web.archive.org/web/20130503115111js_/http://s.stats.wordpress.com/w.js?21" type="text/javascript"></script> <script type="text/javascript"> st_go({'blog':'39034126','v':'wpcom','tz':'0','user_id':'0','subd':'flickrcode'}); function st_vt() {var x=document.createElement("img");x.src="https://web.archive.org/web/20130503115111/http://stats.wordpress.com/g.gif?blog=39034126&v=wpcomvt&tz=0&user_id=0&subd=flickrcode&rand="+Math.random();} ex_go({'crypt':'UE40eW5QN0p8M2Y/RE1BNmNJfGhxNCVxUDExYmtXRThKbHcwXTdETWI1alhvb1oseHImN101ZFpEakVpYjlQYVFLYzBaVHRtPz0wXS9bM1lKdVZKQS1NTGJmdUM0ZHJxVkdbSmJHXy45cWp6UEwwZUM/ZjMuP3ZrOFE9K3hpSjRUOCwuYlFlN3wtd0dqbzBmfFJCaEJDUFdJRDRiV2diPVFrPUVhQkItTF0mYTklaCw3K1cyRW9bP3BSQ349QllLWWNWUUg3TFFFfDg0RjluZTRdSTBZfHUuT3pTa3lkRDB+Lj9hd2lmUzduUUhGMmZWd3UwRVliLTdxWkRC'}); addLoadEvent(function(){linktracker_init('39034126',0);}); </script> <noscript><img src="https://web.archive.org/web/20130503115111im_/http://stats.wordpress.com/b.gif?v=noscript" style="height:0px;width:0px;overflow:hidden" alt=""/></noscript> </body> </html><!-- FILE ARCHIVED ON 11:51:11 May 03, 2013 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 06:41:11 Dec 12, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.667 exclusion.robots: 0.035 exclusion.robots.policy: 0.021 esindex: 0.013 cdx.remote: 45.367 LoadShardBlock: 321.863 (3) PetaboxLoader3.datanode: 210.789 (4) PetaboxLoader3.resolve: 444.701 (3) load_resource: 372.612 -->

Pages: 1 2 3 4 5 6 7 8 9 10