Skip to content

Instantly share code, notes, and snippets.

@tomkap
Last active August 29, 2015 14:21
Show Gist options
  • Save tomkap/435090ad612a4ba6a330 to your computer and use it in GitHub Desktop.
Save tomkap/435090ad612a4ba6a330 to your computer and use it in GitHub Desktop.
I feel pretty, oh so pretty, I feel pretty and witty and gay...
#!/usr/bin/env python
from xml.dom import minidom
from urllib import urlopen
site = 'http://www.nafpaktia-weather.gr/tmp/database.xml'
site_data = urlopen(site).read()
xmldoc = minidom.parseString(site_data)
tags = ['city', 'date', 'time', 'temp'];
for tag in tags:
value = xmldoc.getElementsByTagName(tag)
print('%s => %s') % (tag.upper(), value[0].firstChild.nodeValue)
@tomkap
Copy link
Author

tomkap commented May 24, 2015

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment