Skip to content

Commit

Permalink
Make geographic coordinates more accessible.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetroff committed Sep 4, 2014
1 parent 362c63a commit 07464c8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions server/weather-script.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python2

# Kindle Weather Display
# Matthew Petroff (http://www.mpetroff.net/)
# Matthew Petroff (http://mpetroff.net/)
# September 2012

from xml.dom import minidom
Expand All @@ -14,14 +14,21 @@
# Python 2
from urllib2 import urlopen

#
# Geographic location
#

latitude = 39.3286
longitude = -76.6169



#
# Download and parse weather data
#

# Fetch data (change lat and lon to desired location)
weather_xml = urlopen('http://graphical.weather.gov/xml/SOAP_server/ndfdSOAPclientByDay.php?whichClient=NDFDgenByDay&lat=39.3286&lon=-76.6169&format=24+hourly&numDays=4&Unit=e').read()
weather_xml = urlopen('http://graphical.weather.gov/xml/SOAP_server/ndfdSOAPclientByDay.php?whichClient=NDFDgenByDay&lat=' + str(latitude) + '&lon=' + str(longitude) + '&format=24+hourly&numDays=4&Unit=e').read()
dom = minidom.parseString(weather_xml)

# Parse temperatures
Expand Down

0 comments on commit 07464c8

Please sign in to comment.