<?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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"><channel><title>Disruptive Library Technology Jester &#187; Yahoo pipes</title> <atom:link href="http://dltj.org/tag/yahoopipes/feed/" rel="self" type="application/rss+xml" /><link>http://dltj.org</link> <description>We&#039;re Disrupted, We&#039;re Librarians, and We&#039;re Not Going to Take It Anymore</description> <lastBuildDate>Mon, 06 Feb 2012 20:04:22 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <cloud domain='dltj.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' /> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license> <item><title>Anatomy of the Zotero Library to RSS Feed Pipe</title><link>http://dltj.org/article/zotero-rss-pipe-anatomy/</link> <comments>http://dltj.org/article/zotero-rss-pipe-anatomy/#comments</comments> <pubDate>Fri, 06 Mar 2009 12:30:53 +0000</pubDate> <dc:creator>Peter Murray</dc:creator> <category><![CDATA[Raw Technology]]></category> <category><![CDATA[howto]]></category> <category><![CDATA[rss]]></category> <category><![CDATA[Yahoo pipes]]></category> <category><![CDATA[Zotero]]></category><guid isPermaLink="false">http://dltj.org/?p=788</guid> <description><![CDATA[Note! A new feature on the Zotero website does away with the need to use this Yahoo! Pipe. RSS feeds are now generated by the Zotero website itself. Read more about it on the Zotero blog.Last week I posted about &#8230; <a href="http://dltj.org/article/zotero-rss-pipe-anatomy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<abbr class="unapi-id ignore noPrint" title="http://dltj.org/?p=788"></abbr><div style="border: 2px solid red; text-color: black; background: #EEE; padding:1em;">Note!  A new feature on the Zotero website does away with the need to use this Yahoo! Pipe.  RSS feeds are now generated by the Zotero website itself. <a href="http://www.zotero.org/blog/follow-libraries-and-collections-with-feeds/" title="Zotero Blog  &amp;raquo; Blog Archive   &amp;raquo; Follow Libraries and Collections with Feeds">Read more about it</a> on the Zotero blog.</div><p>Last week I posted about a <a href="http://dltj.org/article/zotero-library-rss/">Yahoo Pipes construct that turns a Zotero website library into an RSS feed</a>.  As Dan Cohen noted in a <a href="http://twitter.com/dancohen/statuses/1265440178" title="Twitter from Dan Cohen to Peter Murray">twitter response</a> to the posting, the Zotero team is planning to add an RSS capability in a future release of the website, so this pipe will ultimately be usurped by that capability, but in the meantime it is <a href="http://pipes.yahoo.com/peteratohiolink/zoterolibraryrss" title="Pipes: Zotero Library to RSS">a handy tool</a>.  It was my first full-scale foray into creating a Yahoo Pipes construct from scratch, so I thought it would be useful to document how it works (in case I need to do something similar again).  You might find this useful, too; especially the part about how to put a pubDate element into the RSS feed.</p><div id="attachment_788" class="wp-caption alignnone" style="width: 937px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center;"><br /><table width="925" cellpadding="0" cellspacing="0"><tr><td colspan="2"><img src="http://cdn.dltj.org/wp-content/uploads/2009/02/pipes-top.png" alt="" title="" width="923" height="422" class="alignnone size-full wp-image-788" /></td></tr><tr><td width="426" valign="top"><img src="http://cdn.dltj.org/wp-content/uploads/2009/02/pipes-left.png" alt="" title="" width="426" height="681" class="alignnone size-full wp-image-789" /></td><td valign="top" style="padding:1em 0 0 1em; text-align:left">A couple of things to note:</p><ul type="disc"><li>The basic structure is to iterate over a list of items.  The modules on the right side (above) work to construct a URL to the Zotero Library page while the modules on the left actually get that page, find the list of items (by defining where the list is located in the HTML structure), and massage them into an RSS feed.  In the case of this example, the Pipe is iterating over a list of <code>&lt;tr&gt;</code> elements in the table that displays the library items.</li><li>Strings with elements separated by periods are XPATH-like constructs.  For instance, the &#8220;Path to Item List&#8221; in the upper right module is <code>body.div.1.div.div.1.table.tbody.tr</code>.  The corresponding XPATH is <code>/html/body/div[2]/div/div[2]/table/tbody/tr</code>.  Note a few things: the leading element (<code>html</code>) is omitted, slashes are replaced by periods, and ordinal numbers are separated from their base elements with periods and are subtracted by 1.  Later on there are examples where attribute names (&#8220;<code>href</code>&#8220;) and references to text nodes (&#8220;<code>content</code>&#8220;) are also included in these path strings.</li></ul></td></tr></table><p><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Graphic representation of the Yahoo! Pipes construct to turn a Zotero library web page into an RSS feed.</p></div><p>The process starts with the two <a href="http://pipes.yahoo.com/pipes/docs?doc=user_inputs#PrivateText" title="Pipes - User Input Modules">Private Text Input</a> modules at the top right &mdash; one each for the Zotero Username and the Zotero User Number.  The defaults are set to my values, and they are marked private &mdash; meaning that if someone clones this pipe, these values are not carried along.</p><p>Directly below is a <a href="http://pipes.yahoo.com/pipes/docs?doc=url#URLBuilder" title="Pipes - URL Modules">URL Builder</a> module.  The base URL is <code>http://www.zotero.org</code>, and there are three path elements:  the first is a connection from the <i>Zotero Username</i> Private Text Input, the second is a connection from the <i>Zotero User Number</i> Private Text Input, and the third is the literal &#8220;<code>items</code>&#8220;.  This builds a URL that looks like <code>http://www.zotero.org/dltj/683/items</code> and that corresponds to the <a href="http://www.zotero.org/dltj/683/items" title="Zotero: Library">Zotero user&#8217;s library items page</a>.</p><p>Starting at the upper left of the diagram, the output of the URL Builder is connected to the URL field of a <a href="http://pipes.yahoo.com/pipes/docs?doc=sources#FetchData" title="Pipes - Source Modules">Fetch Data</a> module.  The &#8220;Path to Item List&#8221; parameter is set to <code>body.div.1.div.div.1.table.tbody.tr</code> and that is a pointer to the portion of the XHTML document that contains the library items.  Because the Zotero website is outputting XML (as XHTML), we can use the Fetch Data module and parse the page as if it was an XML document.  The Path to Item List is an XPATH-like structure that points into the document structure (see note above).  The result of this module is a list of items &mdash; the table rows in this case &mdash; that are processed by the remaining modules.</p><p>The next module down is a <a href="http://pipes.yahoo.com/pipes/docs?doc=operators#Rename" title="Pipes - Operator Modules">Rename</a> module, where the value of the XPATH-like path <code>item.td.0.a.content</code> is copied to the item <code>title</code> element.  The XPATH, from the root of the &#8220;Path to Item List&#8221; in the module above, is <code>td/a</code>; note here the added <code>item</code> at the front and the <code>content</code> at the end. Specifying the zeroth <code>td</code> element isn&#8217;t needed, but it brings symmetry with subsequent modules. <code>content</code> corresponds to the text node under the <code>a</code> element when viewing this as an XML document.</p><p>What follows is a series of <a href="http://pipes.yahoo.com/pipes/docs?doc=operators#Loop" title="Pipes - Operator Modules">Loop</a> modules that act on different parts of the items in the list.  The first builds the <code>link</code> element of the item using the <a href="http://pipes.yahoo.com/pipes/docs?doc=string#StringBuilder" title="Pipes - String Modules">String Builder</a> module.   The <code>href</code> in the XML is a relative path, so the String Builder adds the literal &#8220;<code>http://www.zotero.org</code>&#8221; to the value found in <code>item.td.0.a.href</code> (the <code>href</code> attribute of the anchor element of the first <code>td</code> element).  The resulting string is assigned to the <code>link</code> element of each item in the list.</p><p>The second Loop module encapsulates a <a href="http://pipes.yahoo.com/pipes/docs?doc=date#DateBuilder" title="Pipes - Date Modules">Date Builder</a> module, and this is the inspiration for writing this post.  It took a very long time to figure out how to get the <code>pubDate</code> element into each item of the resulting RSS feed.  As it turns out, one cannot simple assign the <code>pubDate</code> element like we did the <code>title</code> element above.  Instead, one sets the timestamp to the <code>y:published</code> element and Yahoo Pipes takes it from there.  And it isn&#8217;t enough to assign a text string to that element; it has to be a Date type, constructed using the Date Builder module.  The Date Builder module is very flexible in what it accepts, and it creates a canonical timestamp form that can be used by other modules.  In this case, the Date Builder module takes as a source input the string value found at <code>item.td.2.a.content</code>.  Believe me &#8212; it took a long time to figure this out, and it was only done by piecing together various suggestions and examples; there doesn&#8217;t seem to be any clear documentation about this.</p><p>The third and fourth Loop modules go together.  The third takes the value found in <code>item.td.0.a.span.class</code> and applies a <a href="http://pipes.yahoo.com/pipes/docs?doc=operators#Regex" title="Pipes - Operator Modules">String Regex</a> module to it.  The value of that class attribute contains the type of item in the Zotero library, and it takes the form of &#8220;<code>img-book</code>&#8221; or &#8220;<code>img-journalArticle</code>&#8221; or &#8220;<code>img-conferencePaper</code>&#8220;.  There are two regular expressions defined:  the first removes the &#8220;<code>img-</code>&#8221; prefix from each value and the second replaces all instances of an upper case letter with a space plus the lower case version of the letter.  The latter rule turns &#8220;<code>journalArticle</code>&#8221; into &#8220;<code>journal article</code>&#8221; (note that there is a space in this field prior to the <code>\L</code> part).  The result is assigned to the <code>item.itemType</code> element.  This is used in the final Loop module to build a <code>item.description</code> element to create the string: <code>&lt;p&gt;This journal article  was saved to my Zotero library.&lt;/p&gt;</code>.</p><p>That&#8217;s all there is to it.  Yahoo Pipes applies all of these modules to each of the items in the list retrieved from the Zotero library page and generates the corresponding RSS feed.</p>]]></content:encoded> <wfw:commentRss>http://dltj.org/article/zotero-rss-pipe-anatomy/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Zotero Library to RSS Feed</title><link>http://dltj.org/article/zotero-library-rss/</link> <comments>http://dltj.org/article/zotero-library-rss/#comments</comments> <pubDate>Sat, 28 Feb 2009 17:03:54 +0000</pubDate> <dc:creator>Peter Murray</dc:creator> <category><![CDATA[Raw Technology]]></category> <category><![CDATA[rss]]></category> <category><![CDATA[Yahoo pipes]]></category> <category><![CDATA[Zotero]]></category><guid isPermaLink="false">http://dltj.org/?p=774</guid> <description><![CDATA[Note! A new feature on the Zotero website does away with the need to use this Yahoo! Pipe. RSS feeds are now generated by the Zotero website itself. Read more about it on the Zotero blog.Earlier this week, the Zotero &#8230; <a href="http://dltj.org/article/zotero-library-rss/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<abbr class="unapi-id ignore noPrint" title="http://dltj.org/?p=774"></abbr><div style="border: 2px solid red; text-color: black; background: #EEE; padding:1em;">Note!  A new feature on the Zotero website does away with the need to use this Yahoo! Pipe.  RSS feeds are now generated by the Zotero website itself. <a href="http://www.zotero.org/blog/follow-libraries-and-collections-with-feeds/" title="Zotero Blog  &amp;raquo; Blog Archive   &amp;raquo; Follow Libraries and Collections with Feeds">Read more about it</a> on the Zotero blog.</div><p>Earlier this week, the Zotero team <a href="http://www.zotero.org/blog/zotero-15-beta-released-join-us-in-the-clouds/" title="Zotero Blog  &amp;raquo; Blog Archive   &amp;raquo; Zotero 1.5 Beta Released: Join Us In The Clouds">released its 1.5 Beta version</a>.  Among the much anticipated features is the ability to <a href="http://www.zotero.org/support/sync" title="sync    [Zotero Documentation]">synchronize citations</a> among computers and with a display at the Zotero website.  And if you set the profile permissions on the website, anyone can view your display of citations as well.  As <a href="http://www.dancohen.org/" title="Dan Cohen&amp;#8217;s Digital Humanities Blog">Dan Cohen</a>, Director of the Center for History and New Media where Zotero is being created, <a href="http://twitter.com/dancohen/statuses/1247887132" title="Twitter / Dan Cohen: Enjoying browsing the libr ...">points out</a>, it is fun to see what others have added to their Zotero library.  You might even want to watch what others have saved to their library.  That is where this Zotero-to-RSS mashup comes in.</p><p>I&#8217;ve <a href="http://pipes.yahoo.com/peteratohiolink/zoterolibraryrss" title="Pipes: Zotero Library to RSS">set up a Yahoo! Pipe</a> that examines a Zotero user&#8217;s citation page and turns it into an RSS feed.  There is one prerequisite &#8212; the user must have turned on the profile option on the Zotero website to &#8220;Publish Entire Library&#8221; (see figure 1).  If you want to publish your own citations, you&#8217;ll need to set this by using the &#8220;Settings&#8221; link in the upper right corner of any Zotero.org page when you have signed in.</p><div id="attachment_779" class="wp-caption alignnone" style="width: 700px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center;"><img src="http://cdn.dltj.org/wp-content/uploads/2009/02/zotero_privacy_settings1.png" alt="Zotero Privacy Settings" title="Zotero Privacy Settings" width="690" height="241" class="size-full wp-image-779" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Figure 1. Zotero Privacy Settings</p></div><p>To use the Yahoo! Pipe, you will need two bits of information:  the Zotero username and the Zotero user number.  These bits of information are available in the URL of a library on the Zotero website.  For instance, the URL to my Zotero page is::</p><div style="font-size: 110%; font-family:monospace">http://www.zotero.org/<span style="color:red">dltj</span>/<span style="color:green">683</span></div><p>The <span style="color:red;font-family:monospace">dltj</span> is my Zotero Username and <span style="color:green;font-family:monospace">683</span> is my Zotero User Number.  Similarly, for <a href="https://www.zotero.org/dancohen/2">Dan Cohen&#8217;s Zotero page</a>, his Username is <span style="color:red;font-family:monospace">dancohen</span> and his User Number is <span style="color:green;font-family:monospace">2</span>.  With that information you can go to the <a href="http://pipes.yahoo.com/peteratohiolink/zoterolibraryrss" title="Pipes: Zotero Library to RSS">Zotero-to-RSS Yahoo! Pipe</a> (<a href="http://pipes.yahoo.com/peteratohiolink/zoterolibraryrss" title="Pipes: Zotero Library to RSS">http://pipes.yahoo.com/peteratohiolink/zoterolibraryrss</a>), and plug it into the form (see figure 2).  Select the &#8220;Run Pipe&#8221; button and after a few seconds you&#8217;ll see the results.</p><div id="attachment_780" class="wp-caption alignnone" style="width: 700px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center;"><img src="http://cdn.dltj.org/wp-content/uploads/2009/02/yahoo-pipe-config1.png" alt="Yahoo! Pipe Configuration" title="Yahoo! Pipe Configuration" width="690" height="122" class="size-full wp-image-780" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Figure 2. Yahoo! Pipe Configuration</p></div><p>If you see an error &#8220;error fetching&#8221; warning with a &#8220;403 Forbidden&#8221; message, that means the user has not opened up their Zotero library for public viewing.  But if they (or you!) have, then you can use the &#8220;Get as RSS&#8221; link as a way to track additions to the library.  For instance, I&#8217;ve added my Zotero library feed as a &#8220;Blog&#8221; source to <a href="http://friendfeed.com/dltj" title="Peter Murray - FriendFeed">my FriendFeed profile</a>.</p>]]></content:encoded> <wfw:commentRss>http://dltj.org/article/zotero-library-rss/feed/</wfw:commentRss> <slash:comments>11</slash:comments> </item> </channel> </rss>
<!-- Served from: dltj.org @ 2012-02-11 12:04:12 by W3 Total Cache -->
