How do we find up-to-the-minute information on almost every city in the world in just a click? Behind the scenes, worldview works with five APIs to pull detailed data about each city.
Creating the Clock
When you enter in a new city, the name is sent to Weather Underground
's Autocomplete API, which matches your input with the most relevant city and returns its name, state, country and coordinates.
Next, this information is sent to Forecast.io
, which returns the UTC Offset to generate that city's current time. With this information, worldview creates a new clock representing that city.
Finding the Data
With the city's clock created and saved to the database, the next step relies on you.
When you click the clock, all the information previously gathered is split up into separate API calls and sent out to The New York Times
for news, Forecast.io
once again for the current weather, Flickr
for tagged photos and Twitter
for trending tweets carrying the city's hashtag.