Created
December 27, 2018 18:30
-
-
Save mauruskuehne/5f8eaf16569e7f1044889a2237db5b8f to your computer and use it in GitHub Desktop.
add all 35C3 spaces to a new things list. Explore ALL the spaces!
This file contains 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 json, requests, urllib, subprocess | |
language = "de" # switch to "en" for english names | |
resp = requests.get("https://35c3.c3nav.de/api/spaces/") | |
spaces = json.loads(resp.text) | |
addToThingsUri = "things:///add" | |
proj = "things:///add-project?title=35C3 Spaces" | |
subprocess.call(["open", proj]) | |
for x in spaces: | |
title = x["titles"][language] | |
params = "?" | |
params = params + "title=" + urllib.parse.quote(title) | |
params = params + "&list=" + urllib.parse.quote("35C3 Spaces") | |
reqUrl = addToThingsUri + params | |
subprocess.call(["open", reqUrl]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... warning: ensure you have already used the Things api before! You'll get hundreds of dialog messages if you haven't 😭