Hi all. I tried to create feed import from facebook https://www.facebook.com/feeds/page.php?format=rss20&id=57949991447 .
But it did not work. I debugged a little and found that xml page loads with simplexml_load_file(...) function and receive not an xml but a page which tells me that i have an unsupported browser... To resolve this i just added this line

ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");

before simplexml_load_file(...) function was called.

ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
$this->items = simplexml_load_file($this->options['url'], $this->options['class'], $opts);

Sorry for my bad English. I thought i could help you with this.

Comments

Sorin Sarca’s picture

Category: Bug report » Support request

Hi,
this isn't a bug, you can set headers using stream contexts. There is also documentation about this
https://www.drupal.org/node/2190331#XML%20document
and if you click "Stream context options" you'll see
https://www.drupal.org/node/2190331#Stream%20context%20options

Sunilvap’s picture

Thank you for quick reply and help.
Everything works fine.

Sunilvap’s picture

Status: Active » Closed (works as designed)