Created
August 24, 2012 08:32
-
-
Save emilkaiser/3447520 to your computer and use it in GitHub Desktop.
Booli API Python
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 httplib | |
import time | |
from hashlib import sha1 | |
import random | |
import string | |
import json | |
callerId = "YOUR_CALLER_ID" | |
timestamp = str(int(time.time())) | |
unique = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(16)) | |
hashstr = sha1(callerId+timestamp+"YOUR_PRIVATE_KEY"+unique).hexdigest() | |
url = "/listings?q=nacka&callerId="+callerId+"&time="+timestamp+"&unique="+unique+"&hash="+hashstr | |
connection = httplib.HTTPConnection("api.booli.se") | |
connection.request("GET", url) | |
response = connection.getresponse() | |
data = response.read() | |
connection.close() | |
if response.status != 200: | |
print "fail" | |
result = data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment