title: How to obtain Facebook page access_token without logging in or having user interaction
body: <p>I have been reading the Facebook documentation and I must be missing something, as I just cant understand how to get the access token for a page without actually logging in first.  I am trying to create a PHP function using the PHP facebook API so that when I add new stories or tutorials on my site, my site's apps can then automatically post as the page a blurb about them on myy facebook page.  </p>
  
  <p>I have this function working but only when I get the access token from the Graph API Explorer, though the access tokens expire in about an hour.  I can't seem to figure out how to programatically obtain the access_token for the page and query for a new one each time from within my PHP scripts so they don't expire and do not require user interaction.</p>
  
  <pre><code>    function post_to_facebook($title, $message, $link, $picture) {
  
              require '../facebook/src/facebook.php';
  
              $page_token = 'xxx';
  
              $page_id = 'xx';
  
              $facebook = new Facebook(array(
                      'appId'  =&gt; '&lt;app_id&gt;',
                      'secret' =&gt; '&lt;app_secret&gt;',
                      'cookie' =&gt; false,
              ));
  
              $facebook-&gt;setAccessToken($page_token);
  
              try {
                      $ret_obj = $facebook-&gt;api('/'.$page_id.'/feed', 'POST', array(
                                              'caption' =&gt; $title,
                                              'link' =&gt; $link,
                                              'message' =&gt; $message,
                                              'picture' =&gt; $picture
                                       ));
  
              } catch(FacebookApiException $e) {
                      error_log($e-&gt;getType());
                      error_log($e-&gt;getMessage());
  
                      return false;
              }
  
              return true;
      }
  </code></pre>
  
  <p>Can someone explain how I can go about retrieving the access token without manually having to look it up via graph api explorer or having a user login?</p>