Created
October 31, 2011 10:15
-
-
Save johl/1327231 to your computer and use it in GitHub Desktop.
Letzte Initiativen im LiquidFeedback der Piratenpartei unter Python mit der API abrufen: So einfach geht das!
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 requests, json # ggf. requests (http://docs.python-requests.org/en/latest/index.html) installieren mit 'pip install requests' | |
base_url = "https://lqfb.piratenpartei.de/pp/" # oder einen anderen Basis-URL für eine andere LQFB-Instanz | |
key = "xxxxxxx" # Zu finden unter https://lqfb.piratenpartei.de/pp/member/developer_settings.html | |
r = requests.get(base_url + "/api/initiative.html?key=" + key + "&api_engine=json") | |
initiatives = json.loads(r.content) | |
print "Letzte Initiativen: " | |
for initiative in initiatives: | |
print initiative["name"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment