11

Click here to load reader

Adding timezones into Upcoming feeds

Embed Size (px)

DESCRIPTION

This is the presentation I gave at Barcamp Brighton 3 on 6th September 2008. It gives an overview of an approach I have taken to insert timezones into my watchlist REST feed generated by Upcoming. The pipe described here is version 1 which adds a new node into the REST response. Whilst not ideal this is the current solution.

Citation preview

Page 1: Adding timezones into Upcoming feeds

Adding timezones into

your Upcoming feedMatt Harris

1

Page 2: Adding timezones into Upcoming feeds

ProblemUpcoming doesn’t know about timezones

Their events are “floating”

Different timezone events show as the same timezone in your calendar

2

Page 3: Adding timezones into Upcoming feeds

Solution

Add a timezone to the event ... but how?

3

Page 4: Adding timezones into Upcoming feeds

What do we have?Start date, end date, start time, end time

problem: their floating times

longitude/latitudeBad, not actually used

Country code Good, but what about multi-timezone countries

City OK, but it was entered as free text

4

Page 5: Adding timezones into Upcoming feeds

Example Feed { "venue_country_code":"uk", "venue_zip":"SW1P 3NZ", "status":"watch", "end_time":"17:00:00", "venue_state_code":"london", "latitude":"", "personal":"0", "id":"449191", "start_date":"2008-09-15", "geocoding_ambiguous":"", "venue_city":"London", "longitude":"", "venue_country_name":"United Kingdom", "name":"@media Ajax", "start_time":"09:00:00", "geocoding_precision":"", "description":"After a hugely successful, ....",

"venue_state_name":"England", "username":"adactio", "tags":"", "metro_id":"49", "venue_id":"69299", "end_date":"2008-09-16", "venue_phone":"020 7390 1590", "user_id":"81213", "venue_address":"Dean's Yard, Westminster", "venue_name":"Church House ... ", "venue_state_id":"59", "venue_country_id":"6", "venue_url":"http:\/\/url\/", "title":"" },

5

Page 6: Adding timezones into Upcoming feeds

Finding the timezoneCouple of providers with APIs

GeonamesGoogleYahoo Location Extractor

6

Page 7: Adding timezones into Upcoming feeds

Converting to a Timezonehttp://www.geonames.org

Good set of web service methodsDocumentation helpfulVarious response formats

7

Page 8: Adding timezones into Upcoming feeds

ProcessExtract City and Country from

Upcoming Feed

SEARCH for city and country code on GeoNames

Extract Longitude and Latitude from GeoNames response

RETRIEVE timezone from GeoNames

Inject into Upcoming feed

8

Page 9: Adding timezones into Upcoming feeds

Considerations

Time of response - caching?

Frequency of change, how do we keep this up to date?

9

Page 10: Adding timezones into Upcoming feeds

Step up Yahoo Pipes

10