I'm trying to parse a DIGG RSS feed which requires you to grab using CURL because it need browser headers
<?php
$url = 'http://digg.com/rss/index.xml';
$agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
$s = simplexml_load_string(($result));
echo $s;
echo $s->item[0]->title;
?>
and the error....
PHP Notice: Trying to get property of non-object in /Users/herbstzu/Sites/indpages/xmltest.php on line 7
which meand the simplexml_load_string is failing.....
Any siggestions....other feed fail out this way as well.
Thanks
:mad: