Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:51:04+00:00 2026-06-16T04:51:04+00:00

I am creating a facebook feed plugin for wordpress and have it working when

  • 0

I am creating a facebook feed plugin for wordpress and have it working when it is using a local file however I need to load into $fb = new SimpleXMLElement($xmlstr);.

$xmlstr is a variable with the XML in, the content inside that file is from here https://www.facebook.com/feeds/page.php?format=rss20&id=133869316660964 .

Is it possible with SimpleXMLElement to store data from a webpage?

I tried using file_get_contents but it didn’t work. When I use that function facebook gives this error: https://i.stack.imgur.com/BKzzM.jpg when using this code: echo "contents: " . file_get_contents('https://www.facebook.com/feeds/page.php?format=rss20&id=133869316660964');

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:51:05+00:00Added an answer on June 16, 2026 at 4:51 am

    I solved this using the cURL library from PHP.

       // Init a cURL resource
       $ch = curl_init("https://www.facebook.com/feeds/page.php?format=rss20&id=133869316660964");
       curl_setopt( $ch, CURLOPT_POST, false );
       curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
       // Make facebook think it is being accessed by a browser to avoid 
       //compatability issues
       curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; 
       Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
       curl_setopt( $ch, CURLOPT_HEADER, false );
       curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
       $data = curl_exec( $ch );
    

    From there I set the simple xml as $data.

    $fb = new SimpleXMLElement($data);
    

    Hope this helps people in the future!

    It’s important to have:

    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; 
           Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
    

    Because otherwise facebook will think you’re using an out of date browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an iphone app using Facebook apis. I need to get the user's
I'm creating a web app which uses Facebook feed dialog plugin in some pages.
I am creating WordPress plugin to display Total Twitter counter & Feed Subscriber. You
I am creating some application, facebook application and i need to ask you something.
i am creating a music application and i want to integrate facebook into my
I'm creating my facebook APP with Html iframe. I need , when the user
I'm Creating a facebook application using apache-tomcat. I use the Java Facebook API. It
I'm creating a facebook application in flex. I'm actually working on the friends component
I'm currently creating a facebook-like news feed, and I'm wondering if I'm better off
I'm creating a Facebook-like social-network website. For my wall, I have many different kind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.