Last active
December 19, 2015 14:59
-
-
Save sgillies/5972971 to your computer and use it in GitHub Desktop.
Syriac Places.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import feedparser | |
| import json | |
| import requests | |
| feed = feedparser.parse('http://srophe.github.io/srp-places-app/full-atom.xml') | |
| def feature(entry): | |
| return { | |
| 'type': 'Feature', | |
| 'id': entry.id, | |
| 'geometry': entry.get('where'), | |
| 'properties': { | |
| 'title': entry.title, | |
| 'description': entry.description, | |
| 'link': entry.link }} | |
| features = list(map(feature, feed.entries)) | |
| collection = {'type': 'FeatureCollection', 'features': features} | |
| with open("/tmp/syriaca.json", 'w') as f: | |
| f.write(json.dumps(collection, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment