iphone app store rss failed to open
- by suvendu
I write this,
$opts = array(
'http' = array(
'user_agent' = 'PHP libxml agent',
)
);
$context = stream_context_create($opts);
libxml_set_streams_context($context);
$doc = new DOMDocument();
$doc-load("http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/limit=25/xml");
foreach ($doc-getElementsByTagName('item') as $node) {
$title = $node-getElementsByTagName('title')-item(0)-nodeValue;
$desc = $node-getElementsByTagName('description')-item(0)-nodeValue;
$link = $node-getElementsByTagName('link')-item(0)-nodeValue;
$date = $node-getElementsByTagName('pubDate')-item(0)-nodeValue;
echo $title;
echo '<br>';
echo $desc;
}
?