Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get the stream of a public Facebook fanpage in php?
    text
    copied!<p>I want to display my public fanpage feed onto my website via the Facebook API without requiring a login.</p> <p>I'm doing this</p> <pre><code>require_once('../includes/classes/facebook-platform/php/facebook.php'); $fb = new Facebook($api_key, $secret); $fb-&gt;api_client-&gt;stream_get('',$app_id,'0','0','','','','','')); </code></pre> <p>But I get this error </p> <pre><code> Fatal error: Uncaught exception 'FacebookRestClientException' with message 'user id parameter or session key required' in includes/classes/facebook-platform/php/facebookapi_php5_restlib.php:3065 Stack trace: #0 includes/classes/facebook-platform/php/facebookapi_php5_restlib.php(1915): FacebookRestClient-&gt;call_method('facebook.stream...', Array) #1 facebook/api.php(12): FacebookRestClient-&gt;stream_get('', 13156929019, '0', '0', 30, '', '', '', '') #2 {main} thrown in includes/classes/facebook-platform/php/facebookapi_php5_restlib.php on line 3065 </code></pre> <p>Then I figured, because of 'user id parameter or session key required', to add my user id to the call</p> <pre><code>require_once('../includes/classes/facebook-platform/php/facebook.php'); $fb = new Facebook($api_key, $secret); $fb-&gt;api_client-&gt;stream_get(502945616,13156929019,$app_id,'0','0','','','','','')); </code></pre> <p>But then I got this error</p> <pre><code>Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Session key invalid or no longer valid' </code></pre> <p>I'm totally clueless :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload