title: Facebook Graph API to Pull News Feed. Replace discontinued RSS/XML
body: <p>OK, Since facebook has discontinued their RSS feed for their news feed.  I've been trying to figure out how to use Graph API to pull the newsfeed in.  I've been searching but i can not find anything. Am I doing this right? Tried going through the developer.fb docs but can't seem to get it right.  What am I doing wrong?  This is what I've done:  I created an App in developer.fb. enabled user_feed, read_stream (yes i know it is being deprecated), and user_status.  I've also enabled it or made it live.  All i want to do is put the news feed on another website.  </p>
  
  <p>My code is as followed (tried two methods): </p>
  
  <p>`
      
          Open Graph rss
          
          </p>
  
  <pre><code>&lt;/head&gt;
  &lt;body&gt;
      &lt;script&gt;
          window.fbAsyncInit = function() {
              FB.init({
                  appId      : 'MyAppID',
                  xfbml      : true,
                  version    : 'v2.4'
              });
          };
  
          (function(d, s, id){
              var js, fjs = d.getElementsByTagName(s)[0];
              if (d.getElementById(id)) {return;}
              js = d.createElement(s); js.id = id;
              js.src = "//connect.facebook.net/en_US/sdk.js";
              fjs.parentNode.insertBefore(js, fjs);
          }(document, 'script', 'facebook-jssdk'));
      &lt;/script&gt;
  
      &lt;script&gt;
          function feed() {
              FB.api(
                  "/me/feed",
                  function (response) {
                      if (response &amp;&amp; !response.error) {
                          document.write('are we here?'); //no
                          document.write(response.data.message);
                      }
                  }
              );   
          }
  
  
  
          function feed2(){
  
              var page_id = 'my_pageID';  //Also tried appid
              var pageaccessToken='MyAppToken';
  
              FB.api('/' + $page_id + '/feed?access_token=' + pageaccessToken, function(response){
                  document.write("am i here?"); // does not get here
                  if (response &amp;&amp; response.data &amp;&amp; response.data.length){
                      var ul = document.getElementById('pagefeed');
                      for (var j=0; j &lt; response.data.length; j++){
                          var feed = response.data[j];
                          document.write(feed.message);
                          document.write(feed.link);
                      }
                  }
              });
          }
  
      &lt;/script&gt;
  
  
      &lt;button onclick="feed()"&gt;test&lt;/button&gt; 
      &lt;button onclick="feed2()"&gt;feed&lt;/button&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>`</p>