title: How to get page_id from facebook url
body: <p>my question is how get facebook page_id starting from a simple fb url. For example:</p>
  
  <ul>
  <li><a href="http://www.facebook.com/" rel="noreferrer">http://www.facebook.com/</a><strong>vanityurl</strong></li>
  <li><a href="http://www.facebook.com/pages/pagename/" rel="noreferrer">http://www.facebook.com/pages/pagename/</a><strong>pageid</strong></li>
  </ul>
  
  <p>Actually if the url match the string "facebook.com/pages/" I call:</p>
  
  <ul>
  <li><a href="https://graph.facebook.com/" rel="noreferrer">https://graph.facebook.com/</a><strong>pageid</strong></li>
  </ul>
  
  <p>else I call:</p>
  
  <ul>
  <li><a href="https://graph.facebook.com/" rel="noreferrer">https://graph.facebook.com/</a><strong>vanityurl</strong></li>
  </ul>
  
  <p>This approach seems to work well, but it is really empirical and looking at documentation I don't see any suggestion.<br />
  What do you think about?</p>