<?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; conversation</title>
	<atom:link href="http://thecodetrain.co.uk/tag/conversation/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>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>

