G+_L I Posted May 2, 2014 Share Posted May 2, 2014 Python API Data read and data sort example. Pulls data from 2 APIs and displays information, allows users to sort the information and make other API calls. I had a tough time with the sorting since the data returned from the API came into a dictionary object and those don't sort like the lists do. I found a workaround online to convert it to a list of tuples (like a list of lists) and then sort that. Lots of good and free APIs on this page: http://www.webresourcesdepot.com/15-free-apis-you-didnt-hear-about-but-will-make-use-of/ and plenty more with a simple Google search. http://pastebin.com/5QirQybe Link to comment Share on other sites More sharing options...
G+_Jayunderwood Kent Posted May 2, 2014 Share Posted May 2, 2014 nice I love the weather man code it display everything my broad band, IP and weather great code bro Link to comment Share on other sites More sharing options...
G+_Fernando Feijo Posted November 5, 2015 Share Posted November 5, 2015 Love the code, learning a lot from it. Open weather now requires an API key. If someone (late to the game as myself) wants to run the code, you may want to change their URL assembly line to something as below: weatherUrl = 'http://api.openweathermap.org/data/2.5/weather?q='+ cityRegion.replace(' ','%20') + '&appid=' + MYAPI_KEY Where MYAPI_KEY was previously stored, of course, with your API key. After you do that, the call line can now have just the variable defined above: response = urllib2.urlopen(weatherUrl) Hope this helps someone who is wondering what happened. Link to comment Share on other sites More sharing options...
Recommended Posts