Here’s an idea I’ve just had, and mentioned on Twitter:
It would be cool if someone with the necessary skills and bandwidth could provide a service which takes a Twitter search (say, for a hashtag), extracts from it valid UK postcodes, or postcode districts (the first half of a postcode, such as “B44”), and returns a corresponding KML file, which can then be passed to other services, like Google Maps.
It would enable anybody to create a service like Ben Marsh‘s excellent #UKSnow map, but on the fly, and for any term or hash-tag; and especially for one-off or short term issues. Imagine, for instance, the recent meteor seen from a large part of the UK. I could post on Twitter, say:
I just saw a #ShootingStar in B6!
(I did, too!) and others might reply:
I saw #ShootingStar from Waverley Station, EH1 1BB
Good view of #ShootingStar in S9, too!
and we’d very quickly have a map of places from which it had been seen — in the event, such information was posted to Twitter, but there was no easy way to collate it.
A similar service, returning KML for geo-coded tweets, would also be useful, and internationally too, and something combining both might also work.
A task for an upcoming hackday, perhaps? Or one you might like to tackle…
After much discussion on Twitter about this proposal I’m leaving my thoughts as to whether Yahoo! Pipes may be of use with this proposal or not.
Twitter feeds and Twitter Search feeds are heavily used in the Pipes’ world and often hit usage limits. So, in this context, I can’t see Pipes being useful in the collection of tweets. Pipes also has a 30 minute cache period. Tony Hirst (@psychemedia) has suggested using Pipes as a development tool and then using pipe2py to translate the pipe into Python. That could be a suitable approach to circumvent the Pipes’ issues just mentioned.
Could Pipes be used to get lat/lons for postcodes (including partial codes)? It looks like it could, although some checking would be needed on the accuracy of the lat/lons. YQL (Yahoo Query Language) can also do this. This pipe takes a postcode, it can be partial, and plots the location on a map. It shows the location as supplied within Pipes and also the location as taken from the geo.places table within YQL (including bounding box data).
http://pipes.yahoo.com/pipes/pipe.info?_id=e6c997369cf19b244a44b34327c0f605
An example of the KML output for this pipe is
http://pipes.yahoo.com/pipes/pipe.run?_id=e6c997369cf19b244a44b34327c0f605&_render=kml&postcode=ws1
Pipes could also output the data as JSON or PHP.
My gut feeling is that if Pipes is not going to be used to access the tweets then using the REST output from YQL might be more appropriate for the postcodes than using Pipes.
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22b6%22&diagnostics=true
Thanks, Paul, that’s great.