<?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>The Code Train &#187; pipes</title>
	<atom:link href="http://thecodetrain.co.uk/tag/pipes/feed/" rel="self" type="application/rss+xml" />
	<link>http://thecodetrain.co.uk</link>
	<description>Where Neil Crosby talks about coding on the train...</description>
	<lastBuildDate>Sun, 03 Apr 2011 18:15:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Packratius, and the inevitable overwhelming of del.icio.us</title>
		<link>http://thecodetrain.co.uk/2010/06/packratius-and-the-inevitable-overwhelming-of-del-icio-us/</link>
		<comments>http://thecodetrain.co.uk/2010/06/packratius-and-the-inevitable-overwhelming-of-del-icio-us/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 20:22:32 +0000</pubDate>
		<dc:creator>Neil Crosby</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[del.icio.us]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[packrati.us]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[yahoo pipes]]></category>

		<guid isPermaLink="false">http://thecodetrain.co.uk/?p=455</guid>
		<description><![CDATA[<p>I&#8217;ve been using <a href="http://delicious.com">del.icio.us</a> for years. I started using it well before it was bought up by Yahoo!, and for a long time my primary use for it was to store my bookmarks in an always available location &#8211; I used many computers, and not having my bookmarks tied to a single machine always seemed like a good idea.</p>

<p>As time went on, I started paying attention to the &#8220;Most Popular&#8221; feeds on the homepage, and even managed to get on there myself a few times.  It was a good way to find interesting techy links.  Then, when the friends network facility was introduced I started following the links that my friends were saving as well.  All was well.</p>

<p>However, I never really saved as many of the links that I found interesting as I could have done.  There were plenty of occasions when I remembered telling people about particular pages because they were useful, but not being able to find them again myself.  Oh, how I wished I&#8217;d added them to del.icio.us.</p>

<p>The problem is that I&#8217;m lazy.  So, I was really happy when <a href="http://packrati.us">Packratius</a> peeked its nose up to the cage bars.  The idea behind Packratius is that it&#8217;ll keep an eye on your twitter activity and automagically add any links you tweet to del.icio.us (by default with a <code>via:packrati.us</code> tag).  It&#8217;s deceptively simple, and something that deeply interested me &#8211; I immediately signed up.</p>

<h2>A good idea gone overwhelming</h2>

<p>As it turns out, so did quite a few of my friends.  Overnight, my del.icio.us network feed went from being a carefully curated list of links to a mishmash of <a href="http://www.bbc.co.uk/food/recipes/carrotsglazedwithcum_80467">Carrots Glazed with Cum</a>, gowalla updates and twitpics.</p>

<p>Now, to its credit, Packratius has <a href="http://packrati.us/preferences">options</a> to allow you to not auto-delish links tweeted by any twitter clients that you define.  This allows you to not auto tweet twitpics and the like.  Of course, telling it to stop tweeting those things from your own twitter account is great, but it doesn&#8217;t stop you from seeing those updates from other people (/me looks pointedly at <a href="http://simonjobling.com">Simon Jobling</a>).  So, I needed to find a way to split these auto-delished URLs off from the main list.</p>

<p>As it turns out, whilst del.icio.us&#8217; searching abilities are pretty powerful, you can&#8217;t do a simply negative search.  So whilst you could say &#8220;Show me everything in my network feed tagged with &#8216;kittens&#8217; but not &#8216;via:packrati.us&#8217;&#8221; you can&#8217;t say &#8220;Show me everything in my network feed not tagged with &#8216;via:packrati.us&#8217;&#8221;.  Thankfully I came up with a solution to this &#8211; I created a Yahoo! Pipe called &#8220;<a href="http://pipes.yahoo.com/pipes/pipe.info?_id=537a07fd888c1c38dedcb59f6b5f8101">del.icio.us network feed minus packratius</a>&#8220;. (Catchy, huh?)</p>

<p>It&#8217;s a fairly simple pipe, with the following aims:</p>

<ul>
<li>Provide a feed of your del.icio.us network with items tagged with <code>via:packrati.us</code> removed.</li>
<li>Easily customisable to show different peoples&#8217; network feeds.  </li>
</ul>

<p>If you&#8217;ve been having similar problems with Packratius overwhelming your del.icio.us network feed, then give it a go.  I know <a href="http://kulor.com/">James Broad</a> has been finding Packratius overwhelming &#8211; it was his <a href="http://twitter.com/kulor/status/15596311122">tweet</a> that inspired me to finally write this post up, in the hope of benefitting a few more people.</p>

<h2>How does the pipe work?</h2>

<p>Like I said, the pipe&#8217;s fairly simple &#8211; most of the complexity comes from generating the URL to load a given user&#8217;s del.icio.us network feed.</p>

<p>Once we&#8217;ve obtained the network feed, the only thing we need to do is discard all the feed items that contain <code>via:packrati.us</code> as a tag.  Handily, del.icio.us provides us this information in its feeds:</p>

<pre><code>&lt;item&gt;
  …
  &lt;link&gt;

http://wwp.greenwichmeantime.com/time-zone/africa/south-africa/

  &lt;/link&gt;
  &lt;description&gt;
    South Africa is in Southern Africa, 
    at the southern tip of the continent of Africa.
    http:// bit.ly/am78yK
    #statingthebleedingobvious
  &lt;/description&gt;
  &lt;category domain="http://delicious.com/simey_j/"&gt;
    statingthebleedingobvious
  &lt;/category&gt;
  &lt;category domain="http://delicious.com/simey_j/"&gt;
    via:packrati.us
  &lt;/category&gt;
&lt;/item&gt;
</code></pre>

<p>In the feed item above (cut down for space), we can see that as well as <code>via:packrati.us</code>, a <code>statingthebleedingobvious</code> tag has been automatically generated from the hashtag in the original tweet.  This is a great feature of Packratius, but it did mean that I ended up having to do more than a very simple filter to filter out the <code>via:packrati.us</code> tagged feed items.</p>

<p>Instead what I did was create a <code>Filter</code> block in pipes with rules that looked at the first 6 tags on each feed item (the idea being that there isn&#8217;t enough space in a tweet for more than 6 or so tags). If any of them matched <code>via:packrati.us</code> then they&#8217;re discarded from the feed.</p>

<p>The filter I created looked something a little like this:</p>

<blockquote>
  <p>Filter</p>
  
  <p>Block items that match any of the following:</p>
  
  <ul>
  <li>item.category.0.content is via:packrati.us</li>
  <li>item.category.1.content is via:packrati.us</li>
  <li>item.category.2.content is via:packrati.us</li>
  <li>item.category.3.content is via:packrati.us</li>
  <li>item.category.4.content is via:packrati.us</li>
  <li>item.category.5.content is via:packrati.us</li>
  <li>item.category.content is via:packrati.us</li>
  </ul>
</blockquote>

<p>Those first six filter rules cover the instance of more than one tag being applied to the item, and the final filter covers the intances where only a single tag exists.  Simple.</p>

<p>And that&#8217;s all there is to it.  Of course, writing this Pipe wouldn&#8217;t be necessary if del.icio.us allowed us to do a simple negative search. Still, it&#8217;s good that it&#8217;s nice and easy to generate <a href="http://pipes.yahoo.com/pipes/pipe.info?_id=537a07fd888c1c38dedcb59f6b5f8101">this new feed</a> using Pipes.</p>

<p>Hopefully it&#8217;ll be useful to a couple of you.</p>
<div style="display:block"><small><em><a href="http://neilcrosby.com">Neil Crosby</a> also blogs at about t-shirts at <a href="http://iwearcotton.com">I Wear Cotton</a>, writes <a href="http://thetenwordreview.com/users/workingwithme">Ten Word Reviews</a>, and uploads <a href="http://www.flickr.com/photos/thevoicewithin/">photos</a> to flickr.  You can follow a combined feed of posts at <a href="http://neilcrosby.com/">NeilCrosby.com</a>.</em></small></div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://delicious.com">del.icio.us</a> for years. I started using it well before it was bought up by Yahoo!, and for a long time my primary use for it was to store my bookmarks in an always available location &#8211; I used many computers, and not having my bookmarks tied to a single machine always seemed like a good idea.</p>

<p>As time went on, I started paying attention to the &#8220;Most Popular&#8221; feeds on the homepage, and even managed to get on there myself a few times.  It was a good way to find interesting techy links.  Then, when the friends network facility was introduced I started following the links that my friends were saving as well.  All was well.</p>

<p>However, I never really saved as many of the links that I found interesting as I could have done.  There were plenty of occasions when I remembered telling people about particular pages because they were useful, but not being able to find them again myself.  Oh, how I wished I&#8217;d added them to del.icio.us.</p>

<p>The problem is that I&#8217;m lazy.  So, I was really happy when <a href="http://packrati.us">Packratius</a> peeked its nose up to the cage bars.  The idea behind Packratius is that it&#8217;ll keep an eye on your twitter activity and automagically add any links you tweet to del.icio.us (by default with a <code>via:packrati.us</code> tag).  It&#8217;s deceptively simple, and something that deeply interested me &#8211; I immediately signed up.</p>

<h2>A good idea gone overwhelming</h2>

<p>As it turns out, so did quite a few of my friends.  Overnight, my del.icio.us network feed went from being a carefully curated list of links to a mishmash of <a href="http://www.bbc.co.uk/food/recipes/carrotsglazedwithcum_80467">Carrots Glazed with Cum</a>, gowalla updates and twitpics.</p>

<p>Now, to its credit, Packratius has <a href="http://packrati.us/preferences">options</a> to allow you to not auto-delish links tweeted by any twitter clients that you define.  This allows you to not auto tweet twitpics and the like.  Of course, telling it to stop tweeting those things from your own twitter account is great, but it doesn&#8217;t stop you from seeing those updates from other people (/me looks pointedly at <a href="http://simonjobling.com">Simon Jobling</a>).  So, I needed to find a way to split these auto-delished URLs off from the main list.</p>

<p>As it turns out, whilst del.icio.us&#8217; searching abilities are pretty powerful, you can&#8217;t do a simply negative search.  So whilst you could say &#8220;Show me everything in my network feed tagged with &#8216;kittens&#8217; but not &#8216;via:packrati.us&#8217;&#8221; you can&#8217;t say &#8220;Show me everything in my network feed not tagged with &#8216;via:packrati.us&#8217;&#8221;.  Thankfully I came up with a solution to this &#8211; I created a Yahoo! Pipe called &#8220;<a href="http://pipes.yahoo.com/pipes/pipe.info?_id=537a07fd888c1c38dedcb59f6b5f8101">del.icio.us network feed minus packratius</a>&#8220;. (Catchy, huh?)</p>

<p>It&#8217;s a fairly simple pipe, with the following aims:</p>

<ul>
<li>Provide a feed of your del.icio.us network with items tagged with <code>via:packrati.us</code> removed.</li>
<li>Easily customisable to show different peoples&#8217; network feeds.  </li>
</ul>

<p>If you&#8217;ve been having similar problems with Packratius overwhelming your del.icio.us network feed, then give it a go.  I know <a href="http://kulor.com/">James Broad</a> has been finding Packratius overwhelming &#8211; it was his <a href="http://twitter.com/kulor/status/15596311122">tweet</a> that inspired me to finally write this post up, in the hope of benefitting a few more people.</p>

<h2>How does the pipe work?</h2>

<p>Like I said, the pipe&#8217;s fairly simple &#8211; most of the complexity comes from generating the URL to load a given user&#8217;s del.icio.us network feed.</p>

<p>Once we&#8217;ve obtained the network feed, the only thing we need to do is discard all the feed items that contain <code>via:packrati.us</code> as a tag.  Handily, del.icio.us provides us this information in its feeds:</p>

<pre><code>&lt;item&gt;
  …
  &lt;link&gt;

http://wwp.greenwichmeantime.com/time-zone/africa/south-africa/

  &lt;/link&gt;
  &lt;description&gt;
    South Africa is in Southern Africa, 
    at the southern tip of the continent of Africa.
    http:// bit.ly/am78yK
    #statingthebleedingobvious
  &lt;/description&gt;
  &lt;category domain="http://delicious.com/simey_j/"&gt;
    statingthebleedingobvious
  &lt;/category&gt;
  &lt;category domain="http://delicious.com/simey_j/"&gt;
    via:packrati.us
  &lt;/category&gt;
&lt;/item&gt;
</code></pre>

<p>In the feed item above (cut down for space), we can see that as well as <code>via:packrati.us</code>, a <code>statingthebleedingobvious</code> tag has been automatically generated from the hashtag in the original tweet.  This is a great feature of Packratius, but it did mean that I ended up having to do more than a very simple filter to filter out the <code>via:packrati.us</code> tagged feed items.</p>

<p>Instead what I did was create a <code>Filter</code> block in pipes with rules that looked at the first 6 tags on each feed item (the idea being that there isn&#8217;t enough space in a tweet for more than 6 or so tags). If any of them matched <code>via:packrati.us</code> then they&#8217;re discarded from the feed.</p>

<p>The filter I created looked something a little like this:</p>

<blockquote>
  <p>Filter</p>
  
  <p>Block items that match any of the following:</p>
  
  <ul>
  <li>item.category.0.content is via:packrati.us</li>
  <li>item.category.1.content is via:packrati.us</li>
  <li>item.category.2.content is via:packrati.us</li>
  <li>item.category.3.content is via:packrati.us</li>
  <li>item.category.4.content is via:packrati.us</li>
  <li>item.category.5.content is via:packrati.us</li>
  <li>item.category.content is via:packrati.us</li>
  </ul>
</blockquote>

<p>Those first six filter rules cover the instance of more than one tag being applied to the item, and the final filter covers the intances where only a single tag exists.  Simple.</p>

<p>And that&#8217;s all there is to it.  Of course, writing this Pipe wouldn&#8217;t be necessary if del.icio.us allowed us to do a simple negative search. Still, it&#8217;s good that it&#8217;s nice and easy to generate <a href="http://pipes.yahoo.com/pipes/pipe.info?_id=537a07fd888c1c38dedcb59f6b5f8101">this new feed</a> using Pipes.</p>

<p>Hopefully it&#8217;ll be useful to a couple of you.</p>
]]></content:encoded>
			<wfw:commentRss>http://thecodetrain.co.uk/2010/06/packratius-and-the-inevitable-overwhelming-of-del-icio-us/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yahoo! Pipes: Munging, Mixing and Mashing</title>
		<link>http://thecodetrain.co.uk/2009/09/yahoo-pipes-munging-mixing-and-mashing/</link>
		<comments>http://thecodetrain.co.uk/2009/09/yahoo-pipes-munging-mixing-and-mashing/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 17:00:23 +0000</pubDate>
		<dc:creator>Neil Crosby</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[ydn tuesday]]></category>

		<guid isPermaLink="false">http://thecodetrain.co.uk/?p=300</guid>
		<description><![CDATA[<p>Now that my summer holidays are over, I thought I&#8217;d better start blogging again.  So, here we go.</p>

<p>Just after I left Yahoo!, I was asked by YDN if I&#8217;d mind still presenting the talk I was planning to do about Yahoo! Pipes.  Being the wonderful sort of chap I am, I happily agreed.  So, after a couple of months away from the company, on Tuesday I rolled up to give my presentation.  I&#8217;ve got to say, it felt a bit weird giving a talk for a company I no longer worked for.  But, it seemed to go okay.  People asked interesting questions, and they seemed to enjoy me talking about how to make Pipes, and sharing a few of the ones that I&#8217;d previously made with them.</p>

<p>The idea behind the talk was that whilst Pipes is a wonderful tool, it does have a fairly steep learning curve, and many people are dissuaded from using it before they&#8217;ve managed to do anything because of that.  When I started using Pipes two years ago, I wished I had someone who already used it to give me a few pointers, so by giving this talk I hope I helped a few people out in the way that I wish I had been two years previously.</p>

<div style="width:425px;text-align:left" id="__ss_1937195"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/neilcrosby/pipes" title="Yahoo! Pipes: Munging, Mixing and Mashing">Yahoo! Pipes: Munging, Mixing and Mashing</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pipestalk-090901094249-phpapp01&#038;stripped_title=pipes" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pipestalk-090901094249-phpapp01&#038;stripped_title=pipes" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/neilcrosby">Neil Crosby</a>.</div></div>

<p>All the pipes used within the talk are linked within the slide deck, and if you want to look at any of my other pipes, you can find them at <a href="http://pipes.yahoo.com/neilcrosby">pipes.yahoo.com/neilcrosby</a>.</p>
<div style="display:block"><small><em><a href="http://neilcrosby.com">Neil Crosby</a> also blogs at about t-shirts at <a href="http://iwearcotton.com">I Wear Cotton</a>, writes <a href="http://thetenwordreview.com/users/workingwithme">Ten Word Reviews</a>, and uploads <a href="http://www.flickr.com/photos/thevoicewithin/">photos</a> to flickr.  You can follow a combined feed of posts at <a href="http://neilcrosby.com/">NeilCrosby.com</a>.</em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Now that my summer holidays are over, I thought I&#8217;d better start blogging again.  So, here we go.</p>

<p>Just after I left Yahoo!, I was asked by YDN if I&#8217;d mind still presenting the talk I was planning to do about Yahoo! Pipes.  Being the wonderful sort of chap I am, I happily agreed.  So, after a couple of months away from the company, on Tuesday I rolled up to give my presentation.  I&#8217;ve got to say, it felt a bit weird giving a talk for a company I no longer worked for.  But, it seemed to go okay.  People asked interesting questions, and they seemed to enjoy me talking about how to make Pipes, and sharing a few of the ones that I&#8217;d previously made with them.</p>

<p>The idea behind the talk was that whilst Pipes is a wonderful tool, it does have a fairly steep learning curve, and many people are dissuaded from using it before they&#8217;ve managed to do anything because of that.  When I started using Pipes two years ago, I wished I had someone who already used it to give me a few pointers, so by giving this talk I hope I helped a few people out in the way that I wish I had been two years previously.</p>

<div style="width:425px;text-align:left" id="__ss_1937195"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/neilcrosby/pipes" title="Yahoo! Pipes: Munging, Mixing and Mashing">Yahoo! Pipes: Munging, Mixing and Mashing</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pipestalk-090901094249-phpapp01&#038;stripped_title=pipes" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pipestalk-090901094249-phpapp01&#038;stripped_title=pipes" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/neilcrosby">Neil Crosby</a>.</div></div>

<p>All the pipes used within the talk are linked within the slide deck, and if you want to look at any of my other pipes, you can find them at <a href="http://pipes.yahoo.com/neilcrosby">pipes.yahoo.com/neilcrosby</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thecodetrain.co.uk/2009/09/yahoo-pipes-munging-mixing-and-mashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Following Twitter conversations using Yahoo! Pipes</title>
		<link>http://thecodetrain.co.uk/2009/05/following-twitter-conversations-using-yahoo-pipes/</link>
		<comments>http://thecodetrain.co.uk/2009/05/following-twitter-conversations-using-yahoo-pipes/#comments</comments>
		<pubDate>Tue, 26 May 2009 08:41:59 +0000</pubDate>
		<dc:creator>Neil Crosby</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[conversation]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://thecodetrain.co.uk/?p=263</guid>
		<description><![CDATA[<p>One of the things that&#8217;s annoyed me for quite some time about twitter is the lack of an easy way to follow a question/answer flow.  Fairly often someone will ask an interesting question that I&#8217;d quite like to see the answers to, but right now there&#8217;s no easy way to find the tweets which were written in reply to the original question.</p>

<p>This is unfortunate, since twitter does provide an <code>in_reply_to_status_id</code> parameter for tweets, which is set when one tweet is specifically written in reply to another.  If we were able to query this parameter directly then the <a href="http://pipes.yahoo.com/pipes/pipe.info?_id=RveZyJA13hGzacuOgQSecQ&amp;StatusId=1892379235">Twitter Conversation Yahoo! Pipe</a> that I&#8217;ve written would be unnecessary and I wouldn&#8217;t have had to spend a couple of hours writing it.  But I did have to write it, and that&#8217;s okay because it gave me a much better understanding of how to use Pipes.</p>

<p>In order to track twitter conversations (between non-private users), I did the following:</p>

<ol>
<li><p>Find the <code>status_id</code> of the tweet that started the conversation.  </p>

<p>This can found at the end of the tweet&#8217;s URL.</p></li>
<li><p>Make a request to the twitter API to find out who wrote that tweet. </p>

<p>This isn&#8217;t strictly necessary &#8211; the user could provide this too.  However, by working this out for them the user only has to provide one piece of information.</p></li>
<li><p>Make a request to twitter search for any tweets written since the original tweet that contain &#8220;@username&#8221;, where &#8216;username&#8217; is the username of the original tweeter.</p></li>
<li><p>For each search result make a request to the twitter API to find out if that tweet has its <code>in_reply_to_status_id</code> parameter parameter set.  </p>

<p>Yup, that&#8217;s an API request for each of conceivably a lot of tweets.  If the twitter search API returned this data as part of its result set that I could remove this call and be a much happier man.</p></li>
<li><p>Discard any search results which do not have <code>in_reply_to_status_id</code> set to the <code>status_id</code> of the original tweet.</p></li>
<li><p>At this point, I originally wanted to recurse the pipe and run through this process again for all the tweets I&#8217;d just found via the search so as to get a richer conversation experience.  </p>

<p>Unfortunately, due to the massive number of HTTP requests required, Pipes understandably started timing out.</p></li>
<li><p>Finally, add the original tweet to the list of tweets if required and order by time, starting with the original tweet.</p></li>
</ol>

<p>There&#8217;s a fair bit going on there, and things get a bit complicated in the Pipe due to the way various properties had to be manipulated.  It all ends up working pretty well though.</p>

<p>This Pipe becomes more useful once you add a quick little bookmarklet to it.  Drag my <a href="javascript:(function(){var%20tmp%20=%20location.href.split('/');tmp%20=%20(0===tmp.length)%20?%20null%20:%20tmp[tmp.length%20-%201];url='http://pipes.yahoo.com/pipes/pipe.info?_id=RveZyJA13hGzacuOgQSecQ&amp;StatusId='+encodeURIComponent(tmp);a=function(){location.href=url;};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()">Twitter Conversation</a> bookmarklet to your browser&#8217;s bookmarks folder, and then click on it any time you&#8217;re on a tweet page that you think will start an interesting conversation.  You&#8217;ll immediately be taken to a Pipes page which contains the conversation.  Then, you&#8217;ll be happy.</p>

<p>I&#8217;d been wanting to get round to writing this post for a while now, but was finally pushed into getting it written by <a href="http://twitter.com/boagworld/status/1892379235">a statement</a> <a href="http://boagworld.com">Paul Boag</a> made on twitter:</p>

<blockquote>
  <p>Paul Boag: wishes that when somebody asks a question on Twitter you could easily see if anybody else has answered it.</p>
</blockquote>

<p>This was quickly <a href="http://twitter.com/evilstreak/status/1892461405">replied to</a> by <a href="http://www.evilstreak.co.uk/">Dominic Baggott</a>, who had seen my Pipe when <a href="http://twitter.com/NeilCrosby/status/1659668448">I mentioned it</a> a couple of weeks previously on twitter:</p>

<blockquote>
  <p>@boagworld You could check out @NeilCrosby&#8217;s conversation pipe built for pretty much that purpose. http://bit.ly/bCkvL</p>
</blockquote>

<p>Clearly there&#8217;s a want out there for people to be able to see these conversation threads.  </p>

<p>The fact that I&#8217;ve been able to fairly easily hack together the proof of concept in Pipes shows that it wouldn&#8217;t be the most difficult thing in the world for twitter to implement themselves.  Even if twitter just &#8220;flipped a switch&#8221; and turned on output of <code>in_reply_to_status_id</code> in search API results then this hack would become a whole lot more palatable due to the massive reduction in HTTP requests this would mean.  It might even mean that Pipes would be able to recurse into the conversations, which would be fantastic.</p>

<p>UPDATE: <a href="http://darrenf.org/">Darren Foreman</a> has just shown me <a href="http://web.me.com/t_trace/pbtweet.html">pbtweet</a>, which also surfaces conversations in twitter, as well as a few other things, and is also apparently based on Pipes.</p>
<div style="display:block"><small><em><a href="http://neilcrosby.com">Neil Crosby</a> also blogs at about t-shirts at <a href="http://iwearcotton.com">I Wear Cotton</a>, writes <a href="http://thetenwordreview.com/users/workingwithme">Ten Word Reviews</a>, and uploads <a href="http://www.flickr.com/photos/thevoicewithin/">photos</a> to flickr.  You can follow a combined feed of posts at <a href="http://neilcrosby.com/">NeilCrosby.com</a>.</em></small></div>]]></description>
			<content:encoded><![CDATA[<p>One of the things that&#8217;s annoyed me for quite some time about twitter is the lack of an easy way to follow a question/answer flow.  Fairly often someone will ask an interesting question that I&#8217;d quite like to see the answers to, but right now there&#8217;s no easy way to find the tweets which were written in reply to the original question.</p>

<p>This is unfortunate, since twitter does provide an <code>in_reply_to_status_id</code> parameter for tweets, which is set when one tweet is specifically written in reply to another.  If we were able to query this parameter directly then the <a href="http://pipes.yahoo.com/pipes/pipe.info?_id=RveZyJA13hGzacuOgQSecQ&amp;StatusId=1892379235">Twitter Conversation Yahoo! Pipe</a> that I&#8217;ve written would be unnecessary and I wouldn&#8217;t have had to spend a couple of hours writing it.  But I did have to write it, and that&#8217;s okay because it gave me a much better understanding of how to use Pipes.</p>

<p>In order to track twitter conversations (between non-private users), I did the following:</p>

<ol>
<li><p>Find the <code>status_id</code> of the tweet that started the conversation.  </p>

<p>This can found at the end of the tweet&#8217;s URL.</p></li>
<li><p>Make a request to the twitter API to find out who wrote that tweet. </p>

<p>This isn&#8217;t strictly necessary &#8211; the user could provide this too.  However, by working this out for them the user only has to provide one piece of information.</p></li>
<li><p>Make a request to twitter search for any tweets written since the original tweet that contain &#8220;@username&#8221;, where &#8216;username&#8217; is the username of the original tweeter.</p></li>
<li><p>For each search result make a request to the twitter API to find out if that tweet has its <code>in_reply_to_status_id</code> parameter parameter set.  </p>

<p>Yup, that&#8217;s an API request for each of conceivably a lot of tweets.  If the twitter search API returned this data as part of its result set that I could remove this call and be a much happier man.</p></li>
<li><p>Discard any search results which do not have <code>in_reply_to_status_id</code> set to the <code>status_id</code> of the original tweet.</p></li>
<li><p>At this point, I originally wanted to recurse the pipe and run through this process again for all the tweets I&#8217;d just found via the search so as to get a richer conversation experience.  </p>

<p>Unfortunately, due to the massive number of HTTP requests required, Pipes understandably started timing out.</p></li>
<li><p>Finally, add the original tweet to the list of tweets if required and order by time, starting with the original tweet.</p></li>
</ol>

<p>There&#8217;s a fair bit going on there, and things get a bit complicated in the Pipe due to the way various properties had to be manipulated.  It all ends up working pretty well though.</p>

<p>This Pipe becomes more useful once you add a quick little bookmarklet to it.  Drag my <a href="javascript:(function(){var%20tmp%20=%20location.href.split('/');tmp%20=%20(0===tmp.length)%20?%20null%20:%20tmp[tmp.length%20-%201];url='http://pipes.yahoo.com/pipes/pipe.info?_id=RveZyJA13hGzacuOgQSecQ&amp;StatusId='+encodeURIComponent(tmp);a=function(){location.href=url;};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()">Twitter Conversation</a> bookmarklet to your browser&#8217;s bookmarks folder, and then click on it any time you&#8217;re on a tweet page that you think will start an interesting conversation.  You&#8217;ll immediately be taken to a Pipes page which contains the conversation.  Then, you&#8217;ll be happy.</p>

<p>I&#8217;d been wanting to get round to writing this post for a while now, but was finally pushed into getting it written by <a href="http://twitter.com/boagworld/status/1892379235">a statement</a> <a href="http://boagworld.com">Paul Boag</a> made on twitter:</p>

<blockquote>
  <p>Paul Boag: wishes that when somebody asks a question on Twitter you could easily see if anybody else has answered it.</p>
</blockquote>

<p>This was quickly <a href="http://twitter.com/evilstreak/status/1892461405">replied to</a> by <a href="http://www.evilstreak.co.uk/">Dominic Baggott</a>, who had seen my Pipe when <a href="http://twitter.com/NeilCrosby/status/1659668448">I mentioned it</a> a couple of weeks previously on twitter:</p>

<blockquote>
  <p>@boagworld You could check out @NeilCrosby&#8217;s conversation pipe built for pretty much that purpose. http://bit.ly/bCkvL</p>
</blockquote>

<p>Clearly there&#8217;s a want out there for people to be able to see these conversation threads.  </p>

<p>The fact that I&#8217;ve been able to fairly easily hack together the proof of concept in Pipes shows that it wouldn&#8217;t be the most difficult thing in the world for twitter to implement themselves.  Even if twitter just &#8220;flipped a switch&#8221; and turned on output of <code>in_reply_to_status_id</code> in search API results then this hack would become a whole lot more palatable due to the massive reduction in HTTP requests this would mean.  It might even mean that Pipes would be able to recurse into the conversations, which would be fantastic.</p>

<p>UPDATE: <a href="http://darrenf.org/">Darren Foreman</a> has just shown me <a href="http://web.me.com/t_trace/pbtweet.html">pbtweet</a>, which also surfaces conversations in twitter, as well as a few other things, and is also apparently based on Pipes.</p>
]]></content:encoded>
			<wfw:commentRss>http://thecodetrain.co.uk/2009/05/following-twitter-conversations-using-yahoo-pipes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

