as the title say
magicparser is not working with this link
{link saved}
thanks for fast replay
i will try this then feedback
but the wired thing is that it is working on the demo page but never works on the actual php
how so ?
Hello fraizor,
The demo tools sets a user-agent overriding the default user-agent used by PHP, so that may be all it is..
Cheers,
David
--
MagicParser.com
hi
im still facing the same problem
what im doing wrong ?
{code saved}
Hello fraizor,
The code worked fine for me, and also without specifying the user-agent. Please try the CURL equivalent using;
<?php
require("MagicParser.php");
$url = "http://www.example.net/news_rss.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$xml = curl_exec($ch);
curl_close($ch);
MagicParser_parse("string://".$xml,"bbc","xml|RSS/CHANNEL/ITEM/");
function bbc($record)
{
print $record["TITLE"];
}
?>
(don't forget to change example.net to the domain name for your feed)
If still no output of each title, try dumping the XML , so where you have in the above code:
$xml = curl_exec($ch);
...REPLACE with:
$xml = curl_exec($ch);
print $xml;exit();
That might reveal, for example, an HTML error message instead of the expected RSS response...
Cheers,
David
--
MagicParser.com
Hello fraizor,
Try setting a "browser" looking user-agent by adding the following code at the very top of your script;
ini_set('user_agent','Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');
...that may be all that's required, if still no joy if you could post your example code once more I'll check it out further for you...
Cheers,
David
--
MagicParser.com