|
$auth_url = "https://technet.rapaport.com/HTTP/Authenticate.aspx";
$post_string = "username=YOURUSERNAME&password="
. urlencode("YOURPASSWORD");
$request = curl_init($auth_url);
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);
$auth_ticket = curl_exec($request);
curl_close ($request);
$feed_url = "http://technet.rapaport.com/HTTP/DLS/GetFile.aspx";
$feed_url .= "?ticket=".$auth_ticket;
$fp = fopen('c:\rapnetfeed.csv',
'wb');
if ($fp == FALSE)
{
echo "File not opened";
exit;
}
$request = curl_init($feed_url);
curl_setopt($request, CURLOPT_FILE, $fp);
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_TIMEOUT, 300);
curl_exec($request);
curl_close ($request);
fclose($fp);
|
|