Skip to content

Instantly share code, notes, and snippets.

View breyten's full-sized avatar

Breyten Ernsting breyten

View GitHub Profile
@breyten
breyten / get_amsterdam_datapunt.sh
Created March 15, 2016 13:54
Get amsterdam datapoints
#!/bin/bash
for SET in `wget -q -O - 'https://api.datapunt.amsterdam.nl/gebieden/' |jq '.[]' |sed -e 's/"//g;'`; do
echo $SET
for PART in `wget -q -O - $SET |jq '.results[] |._links.self.href' |sed -e 's/"//g;'`; do
echo "* $PART"
wget -q -x $PART
done
done
@breyten
breyten / parse_big_xml.py
Last active June 8, 2016 11:36
Parsing big pretty printed XML files
import sys
import os
import re
import codecs
from lxml import etree
def parse_big_xml(filename, item_tag=u'item'):
with codecs.open(filename, 'r', 'utf-8') as in_file:
output = u''
@breyten
breyten / get_climates.py
Created August 9, 2016 09:37
Gets climate data from wikipedia country pages
#!/usr/bin/env python
import os
import sys
import re
from pprint import pprint
import json
from time import sleep
import requests
from BeautifulSoup import BeautifulSoup