<?php
$output_filename = "testfile.txt";
$host = "http://www.indeed.com/jobs?q=&l=Cuyahoga+Falls%2C+Ohio";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, false);
curl_setopt($ch, CURLOPT_REFERER, "http://www.example.com");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
curl_close($ch);
print_r($result); // prints the contents of the collected file before writing..
// the following lines write the contents to a file in the same directory (provided permissions etc)
$fp = fopen($output_filename, 'w');
fwrite($fp, $result);
fclose($fp);
?>
I am trying to download content off of Indeed.com to download job positions that are currently available. But send the results to a desktop txt file and display within the browser.
Is there a way I can have the script automatically update it self through intervals?
I am only trying to pick up one specific page of the site. - http://www.indeed.com/jobs?q=&l=Cuyahoga+Falls%2C+Ohio
It seems like its not recognizing the URL.
Any help is appreciated. Thanks