Facebook killed Public RSS feeds; how to obtain a Facebook Page RSS with the new Timeline?

后端 未结 5 1520
鱼传尺愫
鱼传尺愫 2020-12-23 08:51

I\'m attempting to pull out a page feed to RSS from Facebook, however each time I attempt to try it, I get an error back in the XML with the following :

<         


        
相关标签:
5条回答
  • 2020-12-23 09:14

    For an easier way to find page id:

    Just view the source for your FB page (or timeline app, previously known as tab), and search for page_id. Replace it with the code provided.

    0 讨论(0)
  • 2020-12-23 09:23

    When there's no page id to be found in the source page, I found the id through the "create a page" link, as in

    https://www.facebook.com/pages/create.php?ref_id=the_#_here

    ahhhh... so good to have my rss feeds back! Thanks, everyone! :D

    0 讨论(0)
  • 2020-12-23 09:23

    Two easy steps to get the RSS/Atom feed :

    • Find the fb_id : http://findmyfacebookid.com/
    • Put it there : https://www.facebook.com/feeds/page.php?format=atom10&id=

    This url generates an Atom feed, but you can change it.

    0 讨论(0)
  • 2020-12-23 09:25

    Here are my directions.

    1. Go to facebook and right-click profile image to get URL and copy the ID
    2. Go here https://graph.facebook.com/ID_GOES_HERE
    3. Take the ID value that is listed on the resulting page and copy it
    4. Go here and paste the new ID https://www.facebook.com/feeds/page.php?id=ID_GOES_HERE&format=rss20
    5. Copy and paste URL into your feed reader
    0 讨论(0)
  • 2020-12-23 09:26

    I got with the same problem. After looking for a solution I found that FB silently killed public RSS support. (see this post from Jesse Stay)

    I understood that I needed to call the API myself and construct the feed (I also need the feed to be parsed by a WP plugin and other stuff.

    So, first of all get an API key (also called app id) and download the PHP Facebook SDK.

    Then download the Universal Feed Generator PHP class. It will generate all the required headers and xml for you.

    Your php script will be like this:

    require('lib/facebook.php'); // require your facebook php sdk
    include("feed_generator/FeedWriter.php"); // include the feed generator feedwriter file
    
    $fb = new facebook(array(
        'appId' =>  'YOUR_APP_ID', // get this info from the facebook developers page
        'secret'=>  'YOUR_SECRET_KEY' // by registering an app
    ));
    $response = $fb->api('/spreetable/feed','GET'); // replace "spreetable" with your fb page name or username
    
    // create the feedwriter object (we're using ATOM but there're other options like rss, etc)
    $feed = new FeedWriter(ATOM);
    
    $feed->setTitle('Spree Table'); // set your title
    $feed->setLink('http://spreetable.com/facebook/feed.php'); // set the url to the feed page you're generating
    
    $feed->setChannelElement('updated', date(DATE_ATOM , time()));
    $feed->setChannelElement('author', array('name'=>'Spree Table')); // set the author name
    
    // iterate through the facebook response to add items to the feed
    foreach($response['data'] as $entry){
            if(isset($entry["message"])){
                $item = $feed->createNewItem();
                $item->setTitle($entry["from"]["name"]);
                $item->setDate($entry["updated_time"]);
                $item->setDescription($entry["message"]);
                if(isset($entry["link"]))
                    $item->setLink(htmlentities($entry["link"]));
    
                $feed->addItem($item);
            }
    }
    
    // that's it... don't echo anything else, just call this method
    $feed->genarateFeed();
    

    Note from the future (2013-07-09): Don't listen to my answer anymore. It's old. Facebook has a new API with new features on its query language so don't bother pulling feeds. Try to use their API in a more fun, intelligent way :)

    0 讨论(0)
提交回复
热议问题