Skip to content

Instantly share code, notes, and snippets.

@AlexArcPy
Forked from emilkaiser/booli.py
Created June 4, 2016 16:26
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 AlexArcPy/bb6d852242f752bc4687b7f9b808f241 to your computer and use it in GitHub Desktop.
Save AlexArcPy/bb6d852242f752bc4687b7f9b808f241 to your computer and use it in GitHub Desktop.
Booli API Python
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