Skip to content

Instantly share code, notes, and snippets.

@emilkaiser
Created August 24, 2012 08:20
Show Gist options
  • Save emilkaiser/3447432 to your computer and use it in GitHub Desktop.
Save emilkaiser/3447432 to your computer and use it in GitHub Desktop.
Booli API PHP
$auth = array();
$auth['callerId'] = "YOUR_CALLER_ID";
$auth['time'] = time();
$auth['unique'] = rand(0, PHP_INT_MAX);
$auth['hash'] = sha1($auth['callerId'] . $auth['time'] . "YOUR_PRIVATE_KEY" . $auth['unique']);
$url = "http://api.booli.se/listings/?q=nacka&" . http_build_query($auth);
$curl = curl_init($url);
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true
));
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($httpCode != 200) {
// fail
}
$result = json_decode($response);
@elden1337
Copy link

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