title: How to get the ID of a page from the url?
body: <pre><code>I need to get this: 1606321809619553
  
  From that: https://www.facebook.com/Free-Travel-Vacations-1606321809619553/?ref=br_rs
  
  This: barackobama
  
  From that: https://www.facebook.com/barackobama/
  
  and This: barackobama
  
  From that: https://www.facebook.com/barackobama
  </code></pre>
  
  <p>I tried this code:</p>
  
  <pre><code>identifier = url.substring(url.lastIndexOf("/"))
  </code></pre>
  
  <p>but it only work when there is not the final slash url ( like in the last case above ).</p>