Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python solution to the GoEuroTest
#!/usr/bin/env python
# encoding: utf-8
Created by Christian Stade-Schuldt on 2013-11-12.
import sys
import os
import csv
import json
import urllib
def main():
url = ""
parameter = "ber"
response = urllib.urlopen(url+parameter)
data = json.loads(
results = []
for result in data["results"]:
_type = result["_type"]
_id = result["_id"]
_name = result["name"]
_latitude = result["geo_position"]["latitude"]
_longitude = result["geo_position"]["longitude"]
results.append([_type, _id, _name, _latitude, _longitude])
with open("output.csv", "wb") as f:
writer = csv.writer(f)
for result in results:
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment