Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2008 02:21
Show Gist options
  • Save anonymous/2362 to your computer and use it in GitHub Desktop.
Save anonymous/2362 to your computer and use it in GitHub Desktop.
<?php
$q = '';
$l = 'wv';
$qry_str = 'publisher=9284102052512106';
$url = "http://api.indeed.com/ads/apisearch?". $qry_str . '&q=' . $q . '&l=' . $l;
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
//curl_setopt($ch, CURLOPT_POST, true); // set POST method
$result = curl_exec($ch); // run the whole process
if(!$result)
{
echo curl_error($ch);
}
curl_close($ch);
echo $result;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment