Jump to content

Failing to load RSS feed


longestdrive

Recommended Posts

Hi

 

I.m trying to load an RSS feed from a google calendar. I'm using a script from the w3schools website which works with the demo RSS feeds. I changed the URL to my google calendar and for some reason it can't open the feed. I get an error:

 

Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity

 

I changed the calendar to a shared one and tried that URL but same result.

 

I found another script specifically for google calendar feed but same results.

 

The scripts open with other feeds but not google calendar.

 

ANy ideas?

 

<?php
//get the q parameter from URL
$q=$_GET["q"];

//find out which feed was selected
if($q=="Google")
  {
  $xml=("https://www.google.com/calendar/feeds/...group.calendar.google.com/private-313f84595f6e8dbfc7dc80f450d3e8be/basic");
  }
elseif($q=="MSNBC")
  {
  $xml=("http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml");
  }

$xmlDoc = new DOMDocument();
$xmlDoc->load($xml);

 

I removed the unique id for the calendar for now

 

Any help appreciated

Link to comment
https://forums.phpfreaks.com/topic/250061-failing-to-load-rss-feed/
Share on other sites

Hi

 

Thanks for the link, I had seen this one -a useful read.

 

I managed to get my code to work on a public feed but can't get it to work on a private calendar. this is wherer the problem sits.

 

If I make the calendar public it works, if I go back to private and use the private url it doesn't work.

 

Am I missing something obvious with google calendar feeds? :confused:

 

Ta

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.