Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. function getFacebookIdentifier($ProfileContent_result){
  2.  
  3.     if(preg_match('/"entity_id":([0-9]+)/', $ProfileContent_result, $matches)){
  4.         return $matches[1];
  5.     }
  6.  
  7.     return false;
  8.  
  9. }
  10.  
  11.  
  12. function getFacebookProfileContent($name){
  13.  
  14.     return sendRequest('https://m.facebook.com/'.$name, [
  15.         'User-Agent: Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.4633 Mobile Safari/537.10+'
  16.     ]);
  17.  
  18. }
  19.  
  20. function sendRequest($url, $headers = []){
  21.  
  22.     $ch = curl_init();
  23.  
  24.     curl_setopt_array($ch, [
  25.         CURLOPT_URL => $url,
  26.         CURLOPT_HTTPHEADER => $headers,
  27.         CURLOPT_SSL_VERIFYHOST => 0,
  28.         CURLOPT_SSL_VERIFYPEER => 0,
  29.         CURLOPT_FAILONERROR => 1,
  30.         CURLOPT_RETURNTRANSFER => 1
  31.     ]);
  32.  
  33.     return curl_exec($ch);
  34.  
  35. }
  36.  
  37.  
  38. $nome = 'inkeliz';
  39.  
  40. if($id = getFacebookIdentifier( getFacebookProfileContent($nome) )){
  41.  
  42.     echo $id;
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement