<?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>Company Blog &#187; ykyat</title>
	<atom:link href="http://edendevelopment.co.uk/blogs/company/category/ykyat/feed/" rel="self" type="application/rss+xml" />
	<link>http://edendevelopment.co.uk/blogs/company</link>
	<description>Eden Development Company Blog</description>
	<lastBuildDate>Sun, 21 Feb 2010 08:22:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Twitter integration from your Rails app</title>
		<link>http://edendevelopment.co.uk/blogs/company/2009/02/26/twitter-integration-from-your-rails-app/</link>
		<comments>http://edendevelopment.co.uk/blogs/company/2009/02/26/twitter-integration-from-your-rails-app/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 13:17:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[ykyat]]></category>

		<guid isPermaLink="false">http://edendevelopment.co.uk/blogs/company/?p=347</guid>
		<description><![CDATA[We&#8217;ve learnt a bit about Twitter from writing ykyat.com.
I particularly want to write about how we fetch Twitter user icons. The icons are stored on AWS (Amazon Web Services) and cannot be deduced from the user name. You have to go through the Twitter API to find the image location.
The first thing I tried was [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve learnt a bit about Twitter from writing <a href="http://ykyat.com">ykyat.com</a>.</p>
<p>I particularly want to write about how we fetch Twitter user icons. The icons are stored on AWS (Amazon Web Services) and cannot be deduced from the user name. You have to go through the Twitter API to find the image location.</p>
<p>The first thing I tried was the <a href="http://twitter4r.rubyforge.org/">Twitter4R</a> library. This seems to be a very powerful library, and if you were writing a full Twitter client in Ruby you&#8217;d definitely want to consider it. It was simple to get the user icons, but the library just felt a little over-the-top for our needs.</p>
<p>Twitter4R seemed to require authentication with every request, and we soon hit the API limit. I realised this is odd because you really don&#8217;t need to authenticate to look at the XML or JSON data about a Twitter user. I decided to go back to basics and do it myself. This is the code for parsing the JSON data and picking up the user icon URL:</p>
<pre lang='ruby'>
def icon_url_for_user(username)
  require 'open-uri'
  require 'json'
  buffer = open("http://twitter.com/users/show/#{username}.json").read
  result = JSON.parse(buffer)
  result['profile_image_url']
end
</pre>
<p>See! Easy!</p>
<p>Most people don&#8217;t change their user icon very often, so once we know where to find a user&#8217;s icon, we don&#8217;t need to ask Twitter for it again for an arbitrary amount of time. A week seems quite sensible. To that end, we created a lookup table in our database to match Twitter user names to their user icon URL. We added an index to the user name column because it acts as the primary key lookup.</p>
<p>When we want to know a user&#8217;s icon, we first look up in our table. If we don&#8217;t yet have it, or if the <code>updated_at</code> date is more than a week ago, we check with Twitter for the image location. Otherwise we use our cached location.</p>
<p>Fast and easy! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://edendevelopment.co.uk/blogs/company/2009/02/26/twitter-integration-from-your-rails-app/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How we made #ykyat</title>
		<link>http://edendevelopment.co.uk/blogs/company/2009/02/25/how-we-made-ykyat/</link>
		<comments>http://edendevelopment.co.uk/blogs/company/2009/02/25/how-we-made-ykyat/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 08:02:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[ykyat]]></category>

		<guid isPermaLink="false">http://edendevelopment.co.uk/blogs/company/?p=288</guid>
		<description><![CDATA[Friday 13th February 2009 was going to be just a normal day, as far as we knew. Then Chris arrived at work at 9am and said, &#8220;We&#8217;re all going to write a new web app today!&#8221; The idea for &#8220;You know you&#8217;re addicted to&#8221; had occurred to Chris the previous day, upon realising that checking [...]]]></description>
			<content:encoded><![CDATA[<p>Friday 13th February 2009 was going to be just a normal day, as far as we knew. Then Chris arrived at work at 9am and said, &#8220;We&#8217;re all going to write a new web app today!&#8221; The idea for &#8220;You know you&#8217;re addicted to&#8221; had occurred to Chris the previous day, upon realising that checking Twitter before email represents a pretty serious Twitter addiction! Chris thought it might be fun to see what else people were addicted to, and bring the funny anecdotes together in a place where people could rate them and comment upon them.</p>
<p>We had a quick 15-minute meeting where Chris outlined the concept to us and drew some sketches. Tris and I got straight to work on designing the models whilst Chris put together a visual concept. We had lots of discussion about the <a href="http://colorschemedesigner.com/">colour scheme</a> before agreeing on the bright pink. James and Richard were to design the front end, Tris did the backend data manipulating and URL routing. As the person with previous experience in the Twitter API, my part was to get data in from Twitter and send responses out.</p>
<p>By 10:20 we knew this was going to work! Having looked up <a href="http://search.twitter.com">search.twitter.com</a> for a few select phrases, we discovered that people were indeed twittering about their various addictions!</p>
<div id="attachment_305" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/ykyat_feed.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/ykyat_feed-300x212.png" alt="Data found on Twitter!" title="Data found on Twitter!" width="300" height="212" class="size-medium wp-image-305" /></a><p class="wp-caption-text">Data found on Twitter!</p></div>
<p><span id="more-288"></span></p>
<p>As James and Richard were cutting up the design and turning it into HTML and CSS, Chris made a very welcome coffee round.</p>
<p>At about 11:15 we had a major success for the data import, upon discovering that Twitter Search can bring back up to 100 results at a time. We thought it was limited to 15. This meant that we could go back and select much more data.</p>
<div id="attachment_303" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/imported_2.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/imported_2-300x199.png" alt="Lots of data for us to use" title="Lots of data for us to use" width="300" height="199" class="size-medium wp-image-303" /></a><p class="wp-caption-text">Lots of data for us to use</p></div>
<p>Obviously, not all this data is particularly interesting, and some of it is just retweets of other people&#8217;s addictions. Tris helped me to tweak the regular expression to filter out unwanted results.</p>
<p>Meanwhile, the front end was coming along nicely:</p>
<div id="attachment_304" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/picture-8.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/picture-8-300x160.png" alt="An early version of the front end" title="An early version of the front end" width="300" height="160" class="size-medium wp-image-304" /></a><p class="wp-caption-text">An early version of the front end</p></div>
<p>At midday Chris bought the domain <a href="http://ykyat.com/">ykyat.com</a>. We were going to use a different domain name, but after seeing that ykyat.com was available, we all agreed that it was a much better domain. I created the Twitter account @<a href="http://twitter.com/ykyat">ykyat</a> and applied the background image and colour scheme to the Twitter page.</p>
<p>There was a mild panic over URL routing &#8211; we wanted to give each ykyat a unique tag, but we also wanted a nice short URL to browse by topic. It was decided to use a tilde when viewing by tag. The routing is rather non-standard for Rails; I found it interesting to see how it is done. Kudos to Tris for more regular expression magic! :)</p>
<p>I spent my lunch break sitting outside the office wondering how best to implement the <code>since_id</code> so as not to bother Twitter Search by asking for the same results more than once. I had three ideas in mind, and it was useful to have a break to consider the most efficient way.</p>
<p>At about 14:00 things were all coming together very nicely! Tris had organised a cron job for the import, and I was very excited to see a tweet of mine imported and displayed in the gorgeous UI that James and Richard had crafted!</p>
<div id="attachment_306" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/yay.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/yay-300x220.png" alt="A tweet imported and displayed" title="A tweet imported and displayed" width="300" height="220" class="size-medium wp-image-306" /></a><p class="wp-caption-text">A tweet imported and displayed</p></div>
<p>James and Richard turned their attention to the rating system whilst Tris set up the live server on Amazon EC2. My next task was to tweet back an @ reply to the addicted person, with the URL to let them know they had been featured on #ykyat. Thanks to the simplicity of the Twitter API, this didn&#8217;t take long &#8230;</p>
<div id="attachment_307" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/on_twitter.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/on_twitter-300x194.png" alt="Ykyat bot responds to the addicted person" title="Ykyat bot responds to the addicted person" width="300" height="194" class="size-medium wp-image-307" /></a><p class="wp-caption-text">Ykyat bot responds to the addicted person</p></div>
<p>Our Git repository was looking quite exciting at about this time!</p>
<div id="attachment_308" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/git.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/git-300x192.png" alt="Everything coming together" title="Everything coming together" width="300" height="192" class="size-medium wp-image-308" /></a><p class="wp-caption-text">Everything coming together</p></div>
<p>I then started to look at bringing in the Twitter user icons. All was going fine until I hit the limit of API requests per hour. We realised that we couldn&#8217;t just ask Twitter for the icon each time every page was loaded; we would have to be  more pragmatic about it. We put the user icons on hold. It was getting to late afternoon by now and we also decided we didn&#8217;t have time for commenting. Although Tris had written the back end to support comments, we were aware that the Twitter authentication needed to be secure and well tested so we didn&#8217;t want to rush that bit.</p>
<p>The last part of the afternoon was spent getting it working on the live server and making a few tweaks and polish to the user interface. We were all very excited to see what we had achieved in a day! Chris announced at 17:42 that we were done. We went home. Half an hour later <a href="http://twitter.com/chrismdp/status/1207232542">Chris announced it on Twitter</a>:</p>
<div id="attachment_320" class="wp-caption alignnone" style="width: 310px"><a href="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/announcement.png"><img style="margin: 0 0 10px 10px; padding: 0; border: 1px solid #aaa;" src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/announcement-300x155.png" alt="Chris announces #ykyat on Twitter" title="Chris announces #ykyat on Twitter" width="300" height="155" class="size-medium wp-image-320" /></a><p class="wp-caption-text">Chris announces #ykyat on Twitter</p></div>
<p>We made a few enhancements over the weekend. Chris worked on the navigator, showing popular categories and popular tweeters. I was itching to leave comments, which was very motivating for me, knowing that I had the power to enable it! I wrote the Twitter authentication and commenting system on Sunday evening and it went live on Monday!</p>
<p>Building #ykyat was an exciting and rewarding experience for all of us. It was good to work together as one team when so often we each work on different projects. It was fascinating to see an idea grow into a live web app in one day. I think we all knew that we could do it, but it was great to be able to prove it to the world!</p>
]]></content:encoded>
			<wfw:commentRss>http://edendevelopment.co.uk/blogs/company/2009/02/25/how-we-made-ykyat/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Announcing ykyat.com</title>
		<link>http://edendevelopment.co.uk/blogs/company/2009/02/13/announcing-ykyatcom/</link>
		<comments>http://edendevelopment.co.uk/blogs/company/2009/02/13/announcing-ykyatcom/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 19:26:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ykyat]]></category>

		<guid isPermaLink="false">http://edendevelopment.co.uk/blogs/company/?p=283</guid>
		<description><![CDATA[I just wanted to quickly let you know about our new web application, ykyat.com. It's a very simple service based on Twitter...]]></description>
			<content:encoded><![CDATA[<div id="attachment_282" class="wp-caption alignnone" style="width: 310px"><img src="http://edendevelopment.co.uk/blogs/company/wp-content/blogs.dir/8/files/2009/02/picture-1-300x160.png" alt="Screenshot of ykyat.com" title="ykyat.com" width="300" height="160" class="size-medium wp-image-282" /><p class="wp-caption-text">Screenshot of ykyat.com</p></div>
<p>I&#8217;ll blog more about this next week, but just wanted to quickly let you know about our new web application, <a href='http://ykyat.com'>ykyat.com</a>. </p>
<p>It&#8217;s a very simple service built on <a href='http://twitter.com'>Twitter</a>. It collates classic &#8216;you know you&#8217;re addicted to&#8230;&#8217; jokes on a central website, and allows them to be rated so that the funniest are promoted for all to see.</p>
<p>It was built partly for fun, and partly as a grand experiment in rapid application design and development: we designed, built and deployed the entire app from the ground up in 8 hours 42 minutes. We learnt a lot from the process and I&#8217;ll be posting a minute by minute diary with some screenshots next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://edendevelopment.co.uk/blogs/company/2009/02/13/announcing-ykyatcom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
