weatherbot
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
weatherbot [2014/08/30 17:09] – [Source Code] sekula | weatherbot [2014/08/31 03:23] (current) – [Talking to WeatherBot] sekula | ||
---|---|---|---|
Line 123: | Line 123: | ||
def CelsiusToFarenheit(temp_celsius): | def CelsiusToFarenheit(temp_celsius): | ||
return temp_celsius*1.8 + 32.0 | return temp_celsius*1.8 + 32.0 | ||
+ | |||
+ | def FarenheitToCelsius(temp_farenheit): | ||
+ | return (temp_farenheit - 32.0)/1.8 | ||
def KPHToMPH(speed_kph): | def KPHToMPH(speed_kph): | ||
Line 136: | Line 139: | ||
wind_speed_kmh = weather_data[' | wind_speed_kmh = weather_data[' | ||
wind_speed_mph = KPHToMPH(wind_speed_kmh) | wind_speed_mph = KPHToMPH(wind_speed_kmh) | ||
+ | | ||
+ | heat_index_farenheit = -42.379 + 2.04901523*temp_farenheit + 10.14333127*humidity - .22475541*temp_farenheit*humidity - .00683783*temp_farenheit*temp_farenheit - .05481717*humidity*humidity + .00122874*temp_farenheit*temp_farenheit*humidity + .00085282*temp_farenheit*humidity*humidity - .00000199*temp_farenheit*temp_farenheit*humidity*humidity | ||
+ | heat_index_celsius = FarenheitToCelsius(heat_index_farenheit) | ||
| | ||
response = "" | response = "" | ||
Line 144: | Line 150: | ||
response += "< | response += "< | ||
response += "< | response += "< | ||
+ | response += "< | ||
response += "< | response += "< | ||
response += "< | response += "< | ||
Line 403: | Line 410: | ||
New York,NY,US | New York,NY,US | ||
or | or | ||
- | New York,US | + | Stockholm,SE |
</ | </ | ||
weatherbot.1409418591.txt.gz · Last modified: 2014/08/30 17:09 by sekula