Skip to content

Instantly share code, notes, and snippets.

@mauruskuehne
Created December 27, 2018 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauruskuehne/5f8eaf16569e7f1044889a2237db5b8f to your computer and use it in GitHub Desktop.
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!
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])
@mauruskuehne
Copy link
Author

... warning: ensure you have already used the Things api before! You'll get hundreds of dialog messages if you haven't 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment