title: Facebook Graph API, content not being scraped properly
body: <p>I have created a Facebook Canvas App.  This canvas app is essentially an image library, the user is able to view images by clicking a 'Next' button - pretty simple.</p>
  
  <p>I am using the Graph API to post to a custom object when a user has 'looked at' an image.  I do this like so (PHP SDK):</p>
  
  <pre><code>$this-&gt;data['facebook']-&gt;api('/me/myapp:look_at', 'post', array(
          'picture' =&gt; current_url()
      ));
  </code></pre>
  
  <p>current_url() is the current URL of the Facebook canvas (https://apps.facebook.com/myapp/image/id).  This page has a series of og meta tags:</p>
  
  <pre><code>   &lt;meta property="og:title" content="&lt;?=$image-&gt;title?&gt;" /&gt;
     &lt;meta property="og:description" content="Pic of &lt;?=$image-&gt;title?&gt;" /&gt;
     &lt;meta property="og:image" content="https://www.***.com/***/images/&lt;?=$image-&gt;src?&gt;" /&gt;
     &lt;meta property="fb:app_id" content="&lt;?=FB_APP_ID?&gt;" /&gt;
     &lt;meta property="og:url" content="&lt;?=current_url();?&gt;" /&gt;
     &lt;meta property="og:type" content="myapp:picture" /&gt;
  </code></pre>
  
  <p>I have read that when adding the image to the library I need to get Facebook to scrape the page for the og:tags.  I do this using the following:</p>
  
  <pre><code>file_get_contents('https://graph.facebook.com?id=https://apps.facebook.com/myapp/image/'.url_title($_POST['title']).'/'.$data['image_id'].'&amp;scrape=true');
  </code></pre>
  
  <p>However, I'm pretty certain that this isn't working, after placing a mail() call in the app, visiting that URL and waiting nothing comes through, suggesting that it isn't being scraped.</p>
  
  <p>When running the first block of code (calling Graph API myapp:look_at) I get the following exception from Facebook:</p>
  
  <pre><code>Fatal error: Uncaught OAuthException: (#3502) Object at URL https://apps.facebook.com/myapp/image/img/id has og:type of 'website'. The property 'picture' requires an object of og:type 'myapp:picture'. thrown in /****/application/libraries/base_facebook.php on line 1106
  </code></pre>
  
  <p>If I use Facebook's debugger tool to scrape the page I get all of the info.  If I then revisit the canvas page where the FB Graph API call is made then everything goes through fine.  I have read on other SO posts that this is a common problem, and I need  to ask Facebook to scrape the page before calling the Graph API, which is precisely what I'm trying to do in the third block of code above (file_get_contents) without luck.</p>
  
  <p>I guess my question would be: Am I going about this in the right way?  I am struggling to find any clear documentation on the process when it is used in this way.</p>
  
  <p>If I am going about it the right way, why is my page not being scraped when calling file_get_contents('https://app....)?</p>
  
  <p>Sorry for the long post, I'm trying to give you the full picture.</p>
  
  <p>Thanks</p>