I have to import EPF data from itunes Store daily so i have to write a script which will authenticate me firstly through the feeds url and then allow me to download the file automatically through script.
But, i am not finding any way to authenticate myself through url:
http://feeds.itunes.apple.com/feeds/
firstly i downloaded it manually but now i want my script to download it daily. How i can authenticate myself for this? Or there is any other way to achieve this?
Any ideas or view will be highly appreciated.
I did it through curl and now i am in it.
$username = "username";
$password = "password";
$url = "http://feeds.itunes.apple.com/feeds/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
it was this much simple :)