Last active
August 29, 2015 14:00
-
-
Save tom-henderson/d7db9adf6caf4c7c3fbf to your computer and use it in GitHub Desktop.
Eventfinda quick start.
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 base64 | |
import requests | |
from pprint import pprint | |
url = "http://api.eventfinder.co.nz/v2/events.json" | |
username = "xxxxx" | |
password = "xxxxx" | |
auth = base64.encodestring('%s:%s' % (username, password)).replace('\n','') | |
headers = {'Authorization': "Basic %s" % auth } | |
payload = {'rows': 1} # Number of results | |
result = requests.get(url, params=payload, headers=headers) | |
pprint(result.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment