Awaken

Index

Apr 4th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.30 KB | None | 0 0
  1. <?php
  2.  
  3. $json = true;
  4. $error = true;
  5.  
  6. $name = trim(strtolower($_GET['name']));
  7. system("C:\xampp\htdocs\Skype4ComUserProfile.exe " . escapeshellarg($name), $return);
  8.  
  9. if($return != 0)
  10. {
  11.     if($json && $error)
  12.     {
  13.         echo json_encode(array('status' => 'error', 'error' => 'An error occured, please try again later.'));
  14.     }
  15.     else
  16.     {
  17.         // do nothing?
  18.         if($error)
  19.         {  
  20.             echo 'An error occured, please try again later.';
  21.         }
  22.     }
  23.    
  24.     die();
  25. }
  26.  
  27. sleep(1.5); // time it can take Skype to find a user profile and log it. If this doesn't seem to work or you have a slow connection, increase this as necessary.
  28.  
  29. $name = str_replace(".", "\.", $name);
  30. $name = str_replace("'", "\'", $name);
  31. $name = str_replace("_", "\_", $name);
  32.  
  33. $log = array_pop(glob('skype/debug-*.log'));
  34. $contents = file_get_contents($log);
  35.  
  36. if(preg_match('/' . $name . '.*?-r(\d+\.\d+\.\d+\.\d+)/', $contents, $results))
  37. {
  38.     if($json)
  39.     {
  40.         echo json_encode(array('status' => 'success', 'success' => $results[1]));
  41.     }
  42.     else
  43.     {
  44.         echo $results[1];
  45.     }
  46. }
  47. else
  48. {
  49.     if($json)
  50.     {
  51.         echo json_encode(array('status' => 'error', 'error' => 'Either that username was not found, or an error occured.'));
  52.     }
  53.     else
  54.     {
  55.         // do nothing?
  56.         if($error)
  57.         {  
  58.             echo 'Either that username was not found, or an error occured.';
  59.         }
  60.     }
  61. }
  62.  
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment