Jump to content

Google news rss feed on site


synking

Recommended Posts

i am trying to add a google news rss feed to the website i am making. i currently have this code

 

// $location = URL of feed. 
function load_xml_feed($location)
{
    $feedXml = simplexml_load_file($location); 
    foreach ($feedXml->channel->item as $article)
    {
       print '<a href="' . (string)$article->link . '">' . (string)$article->title . '</a><br>'; 
    } 
}

 

but it does not work for google news. anyone know why.

Link to comment
https://forums.phpfreaks.com/topic/112662-google-news-rss-feed-on-site/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.