<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>The official Tumblr for @whensmybus, the Twitter bot that gives you London bus info in realtime. 
Latest NewsAbout/FAQSource Code

Brought to you by Chris Applegate


new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 3,
  interval: 30000,
  width: 'auto',
  height: 300,
  theme: {
    shell: {
      background: '#ffffff',
      color: '#333333'
    },
    tweets: {
      background: '#f8f8f8',
      color: '#333333',
      links: '#cc0000'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('whensmybus').start();
</description><title>When's My Bus?</title><generator>Tumblr (3.0; @whensmybus)</generator><link>http://whensmybus.tumblr.com/</link><item><title>Upgrade: some tweaks and things</title><description>&lt;p&gt;I&amp;#8217;ve given &lt;a href="https://twitter.com/whensmybus"&gt;@whensmybus&lt;/a&gt; a few tweaks and upgrades this weekend. These include:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Two buses are better than one&lt;br/&gt;&lt;/strong&gt;In case you miss the first bus, to save you resending the same request, @whensmybus will now show the time of the next bus after it as well - if there is a second bus listed for your route.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Better language understanding&lt;/strong&gt;&lt;br/&gt;There were a few bugs appearing here or there for people whose Tweets were close to, but not exactly, matching the standard &amp;#8220;@whensmybus 11 from Trafalgar Square&amp;#8221; format. I&amp;#8217;ve revamped the parser from scratch so it&amp;#8217;s now a bit more flexible - but remember that it&amp;#8217;s best to stick as close to the format as possible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Split Tweets now work properly&lt;/strong&gt;&lt;br/&gt;An iffy bug meant that if your bus times had to be split over two Tweets for reason of length (this doesn&amp;#8217;t happen very often), it would lop off the final character (meaning the time of your next bus would be incomplete). Oops. Now fixed.&lt;/p&gt;
&lt;p&gt;Any more bugs you find while using the service, please report to me, &lt;a href="http://twitter.com/qwghlm"&gt;@qwghlm&lt;/a&gt;, not the bot (it won&amp;#8217;t understand you). Happy travels!&lt;/p&gt;</description><link>http://whensmybus.tumblr.com/post/20344732786</link><guid>http://whensmybus.tumblr.com/post/20344732786</guid><pubDate>Mon, 02 Apr 2012 07:34:17 -0400</pubDate></item><item><title>Now supporting multiple bus routes!</title><description>&lt;p&gt;2011 is nearly over, so have a present to welcome 2012 in with. &lt;a href="http://twitter.com/#!/whensmybus"&gt;@whensmybus&lt;/a&gt; now supports multiple bus routes, e.g.:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@whensmybus 135 277 D7&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can ask for a maximum of three routes - you will get multiple Tweets back, one for each route. And of course it works with placenames too:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@whensmybus 135 277 D7 from Canary Wharf&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Best of all, if you are making a request with a GPS tag or a placename specified, they don’t have to all stop at the same stop. @whensmybus will work out the nearest stops on each route individually, and  give you the information for each one accordingly. So, if you have two different buses to the same destination, but arriving at different stops, you can use this to work out which one comes first!&lt;/p&gt;
&lt;p&gt;Have a great 2012!&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;</description><link>http://whensmybus.tumblr.com/post/15016183265</link><guid>http://whensmybus.tumblr.com/post/15016183265</guid><pubDate>Fri, 30 Dec 2011 02:01:00 -0500</pubDate></item><item><title>Direct Messages now supported!</title><description>&lt;p&gt;Due to popular demand, I have added a new feature to &lt;a href="http://twitter.com/whensmybus" title="When's My Bus? on Twitter"&gt;@whensmybus&lt;/a&gt;: you can now make requests via Direct Message as well as @ reply. Just Direct Message in the same format you make ordinary requests, e.g:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;d whensmybus 135 from Canary Wharf&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;However, there&amp;#8217;s one big drawback of Direct Messages - they do not support geolocation at all (even on Twitter on a smartphone); so if you are using a Direct Message to get your bus times you &lt;em&gt;must &lt;/em&gt;use say &amp;#8220;from &lt;em&gt;&amp;lt;placename&amp;gt;&lt;/em&gt;&amp;#8221; in your message.&lt;/p&gt;
&lt;p&gt;Happy Messaging!&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;</description><link>http://whensmybus.tumblr.com/post/14974283564</link><guid>http://whensmybus.tumblr.com/post/14974283564</guid><pubDate>Fri, 25 Nov 2011 00:00:00 -0500</pubDate></item><item><title>@whensmybus gets a whole lot better</title><description>&lt;p&gt;Wow. It&amp;#8217;s been nine days since &lt;a href="http://www.qwghlm.co.uk/2011/10/03/introducing-whensmybus/"&gt;@whensmybus was released&lt;/a&gt; and the feedback has by and large been positive. It&amp;#8217;s not all been plain sailing - the odd bug or two made it past my initial testing, and a database update I tried inadvertently corrupted it all. My thanks go to &lt;a href="http://twitter.com/#!/licencetogil"&gt;@LicenceToGil&lt;/a&gt;, &lt;a href="http://twitter.com/#!/randallmurrow"&gt;@randallmurrow&lt;/a&gt; and &lt;a href="http://twitter.com/#!/christiane"&gt;@christiane&lt;/a&gt; who were all unlucky enough to manage to break it. As a result, I&amp;#8217;ve ironed out some of the bugs, and even put in some unit testing to make sure new deployments don&amp;#8217;t explode. I now feel this is &lt;a href="https://github.com/qwghlm/WhensMyBus"&gt;A Proper Software Project&lt;/a&gt; and not a plaything.&lt;/p&gt;
&lt;p&gt;Bugfixes are all very well, but&amp;#8230; by and far away the most requested feature was to allow people to get bus times without needing a GPS fix, to allow use on Twitter via the web, desktop app or not-so-smartphone. And although using GPS is easier, and cool and proof-of-concepty, it&amp;#8217;s plain to see that making access to the app as wide as possible is what makes it &lt;em&gt;really useful&lt;/em&gt;. So, from now on you can check the time of a London bus by specifying the location name in the Tweet, such as:&lt;/p&gt;
&lt;blockquote&gt;@whensmybus 55 from Clerkenwell&lt;/blockquote&gt;
&lt;p&gt;This will try and find the nearest bus stop in Clerkenwell for your bus - in this case, &lt;a href="http://maps.google.co.uk/maps?q=Clerkenwell+Green+bus+stop&amp;amp;hl=en&amp;amp;ll=51.522309,-0.104306&amp;amp;spn=0.003611,0.008487&amp;amp;sll=51.522449,-0.102922&amp;amp;sspn=0.001806,0.004243&amp;amp;vpsrc=6&amp;amp;hnear=Clerkenwell+Green+(Stop+K)&amp;amp;t=m&amp;amp;z=17"&gt;the stops on Clerkenwell Road&lt;/a&gt;, which are probably what you&amp;#8217;d want). The more precise the location given, the better; place names are OK, street names are better. It works great on postcodes and TfL&amp;#8217;s &lt;a href="http://www.tfl.gov.uk/termsandconditions/20914.aspx"&gt;SMS bus stop codes&lt;/a&gt; as well.&lt;/p&gt;
&lt;p&gt;The geocoding that makes this possible is thanks to the &lt;a href="http://developer.yahoo.com/geo/placefinder/"&gt;Yahoo! PlaceFinder API&lt;/a&gt;, so my thanks goes to them for making a service free for low-volume use. (Aside: you may ask why not use Google Maps? Because Google Maps&amp;#8217;s API terms only allow it to be used to generate a map, not for other geo applications like this).&lt;/p&gt;
&lt;p&gt;So, play away, and let me know what you think. Of course, it may not always work - geocoding is tricky and not foolproof; if it doesn&amp;#8217;t, please let me know in the comments here, or just ping me at &lt;a href="http://twitter.com/qwghlm"&gt;@qwghlm&lt;/a&gt; on Twitter.&lt;/p&gt;
&lt;p&gt;More information and FAQs can be found on the &lt;a href="http://www.qwghlm.co.uk/whensmybus/"&gt;about page&lt;/a&gt;, and the technically-minded of you might want to check out the code on &lt;a href="https://github.com/qwghlm/WhensMyBus"&gt;github&lt;/a&gt;.&lt;/p&gt;</description><link>http://whensmybus.tumblr.com/post/14974109323</link><guid>http://whensmybus.tumblr.com/post/14974109323</guid><pubDate>Thu, 13 Oct 2011 00:00:00 -0400</pubDate></item><item><title>Introducing @whensmybus</title><description>&lt;p&gt;A few weeks ago TfL put all their information from Countdown, the service they use to provide bus arrival times, online. There’s a &lt;a href="http://countdown.tfl.gov.uk/"&gt;TfL Countdown website&lt;/a&gt; and you can enter a bus stop name, or ID number, and find out the latest buses from the stop.&lt;/p&gt;
&lt;p&gt;But, it’s a bit fiddly. The main website doesn’t automatically redirect you to the mobile version if you are on a phone. If you type in a location, (e.g. my local Tube station, “Limehouse Station”), you have to &lt;a href="http://countdown.tfl.gov.uk/search?searchTerm=Limehouse+station"&gt;pick a match for the location&lt;/a&gt; first (from two identically-named options), &lt;em&gt;then&lt;/em&gt; a second screen asking you to &lt;a href="http://countdown.tfl.gov.uk/stopsNearLocation/1772"&gt;find a bus stop&lt;/a&gt;, and then you get the &lt;a href="http://countdown.tfl.gov.uk/arrivals/53452"&gt;relevant times&lt;/a&gt;. On a phone, it&amp;#8217;s just feels fiddly and frustrating &lt;del&gt;especially when I know my phone has GPS in it and knows my location anyway.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update/correction&lt;/strong&gt; There is, as it turns out, the ability to find by geolocation on the mobile site, it&amp;#8217;s just on a mobile browser I just get the main website and don&amp;#8217;t get redirected to the special mobile site, which means I never knew about it (thanks to Ade in the comments for pointing this out).&lt;/p&gt;
&lt;p&gt;If only there was a mobile-friendly, geolocation aware, real-time way of fetching information. Oh wait. There is. It&amp;#8217;s called Twitter. Twitter has &lt;a href="http://blog.twitter.com/2009/08/location-location-location.html"&gt;geolocation allowed on Tweets&lt;/a&gt; (if you opt in) and &lt;a href="https://dev.twitter.com/"&gt;an API&lt;/a&gt; to fetch and send messages, so we have a system set up already in place for our needs.&lt;/p&gt;
&lt;p&gt;I owe a big debt of gratitude to &lt;a href="http://adrianshort.co.uk/2011/09/08/open-data-for-everyday-life/"&gt;Adrian Short&lt;/a&gt;, who wrote &lt;a href="https://github.com/adrianshort/countdown"&gt;a Ruby script&lt;/a&gt; to pull bus times from TfL. TfL have not officially released an API for Countdown just yet, but Adrian found it, and it&amp;#8217;s there and accessible - providing the &lt;a href="http://countdown.tfl.gov.uk/stopBoard/53410"&gt;data in JSON format&lt;/a&gt; for each stop. That use got me thinking - if that data is available and can be parsed quickly and easily, why not make a Twitter bot for it?&lt;/p&gt;
&lt;p&gt;With that, &lt;a href="http://twitter.com/#!/whensmybus"&gt;@whensmybus&lt;/a&gt; was born, and is now in beta. Try it out now if you like. Make sure your Tweet has geolocation turned on (for which you&amp;#8217;ll need a GPS-capable smartphone), and send a message like:&lt;/p&gt;
&lt;blockquote&gt;@whensmybus 135&lt;/blockquote&gt;
&lt;p&gt;Or whatever bus you are looking for. Within 60 seconds, you&amp;#8217;ll get a Tweet back with the times of the next buses for that route, in each direction, from the stops closest to your location.&lt;/p&gt;
&lt;p&gt;Why each direction? Specifying a direction is fiddly and ambiguous; bus routes wind and twist, and some of them are even circular, so &amp;#8220;northbound&amp;#8221; and &amp;#8220;southbound&amp;#8221; are not easy things to parse. The name of your destination can have ambiguous spellings, and I haven&amp;#8217;t yet got round to tying it in with a geocoding service like Google Maps. So, at the moment the bot simply tells you buses in both directions from the stops nearest to you. I might change this in future, once I&amp;#8217;ve got my head around geolocation services and fuzzy string matching and all that.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s still beta (thanks to an early unveiling by &lt;a href="http://twitter.com/#!/SianySianySiany/status/120781280387416064"&gt;Sian&lt;/a&gt; ;) ) and I plan in future to add enhancements such as the ability to use without GPS. &lt;del&gt;I also need to write some proper documentation for it, and stick the source code on Github later tonight once I am home&lt;/del&gt;. The source code is &lt;a href="https://github.com/qwghlm/WhensMyBus"&gt;now available on github&lt;/a&gt;, but do bear in mind the codebase is a bit unstable right now. So, if you are a Londoner, please do use it and tell me what you think, either on the comments below or on &lt;a href="http://twitter.com/qwghlm"&gt;Twitter&lt;/a&gt;. @ me, don&amp;#8217;t @ the bot - it will think it&amp;#8217;s a request for a bus service and get confused. :) All suggestions are welcome.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(And now, some tech stuff for the more interested)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The bot is a Python script, run every minute via a cronjob. It&amp;#8217;s quite short - 350 lines including comments for the main bit. As well as the live data API, the service also uses two databases officially provided by &lt;a href="http://www.tfl.gov.uk/businessandpartners/syndication/default.aspx"&gt;TfL&amp;#8217;s syndication service&lt;/a&gt; for free; one is of all the routes, and one for all the bus stop locations. I converted these from CSV format to sqlite so the bot can make SQL queries on the data. TfL use &lt;a href="http://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid"&gt;OS Easting and Northing&lt;/a&gt; locations for the bus stops, so I have to convert the GPS longitude and latitude; I am indebted to &lt;a href="http://www.movable-type.co.uk/scripts/latlong-gridref.html"&gt;Chris Veness&lt;/a&gt; and his lat/lng to OS conversion script, which I translated from JavaScript to Python; I am also now much more educated on subtleties like the &lt;a href="http://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid#Datum_shift_between_OSGB_36_and_WGS_84"&gt;difference between OSGB36 and WGS84&lt;/a&gt;. Finally, I use the &lt;a href="http://code.google.com/p/tweepy/"&gt;Tweepy&lt;/a&gt; library to receive and send the Tweets, which is really rather excellent and saves a lot of faff. Finally, the whole project would not be possible without the ideals of open data and open source software behind it, so if you&amp;#8217;ve written even a single line of free software, then thank you as well.&lt;/p&gt;</description><link>http://whensmybus.tumblr.com/post/14974069369</link><guid>http://whensmybus.tumblr.com/post/14974069369</guid><pubDate>Mon, 03 Oct 2011 00:00:00 -0400</pubDate></item><item><title>Hello world!</title><description>&lt;p&gt;This isn&amp;#8217;t much of a blog per se, but just a repository of information and updates about the &lt;a href="http://twitter.com/whensmybus"&gt;@whenmybus&lt;/a&gt; Twitter app as I roll out new features.&lt;/p&gt;</description><link>http://whensmybus.tumblr.com/post/14974018805</link><guid>http://whensmybus.tumblr.com/post/14974018805</guid><pubDate>Sat, 01 Oct 2011 00:00:00 -0400</pubDate></item></channel></rss>
