Skip to content

Instantly share code, notes, and snippets.

@sgillies
Last active December 19, 2015 14:59
Show Gist options
  • Save sgillies/5972971 to your computer and use it in GitHub Desktop.
Save sgillies/5972971 to your computer and use it in GitHub Desktop.
Syriac Places.
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