LearnProgramming/LPMCBot — pull request #61 by fastturtle (2012-09-18 19:42:43+00:00)
Title: Weather

I have added a `!weather` command to the LPMCBot. It takes a zip code as its second command and returns the temperature at that location in both Fahrenheit and Celsius. If more than two zip codes are supplied only the first is used. If no zip code is supplied the bot gives an error message and recommends setting a zip code.

Here is the general format for the command: `!weather `, and an example: `!weather 10012`.

This command makes a call to the function `weatherlookup()` which uses the http://worldweatheronline.com/ API to handle weather lookups. An example of a response from the API can be found [here](http://free.worldweatheronline.com/feed/weather.ashx?q=10012&format=json&num_of_days=2&key=67cd8f4a2f184852121809). Currently only a small piece of the available weather information is being used. It could be possible to extend the functionality of the command to do display more detailed weather information.

Just as a side note, the weather look up uses the requests module. Should this be included in a requirements file?