Advertisement
janter13

invite fp

Apr 7th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.62 KB | None | 0 0
  1. <?php
  2.  
  3. $key = 'cookie login fb';
  4. $tkn = 'token fb';
  5.  
  6. echo '<div class="acy apm abb abt"> <b>Hello Gunakan Form Dibawah Ini Untuk Mengundang Teman Kamu Menyukai FP</b></div>
  7. <form method="post">
  8. ID FP :<br>
  9. <input type="text" name="id"><br>
  10. <input value="Invite FP" type="submit" name="add" class="btn btnC largeBtn" size="0" />
  11. </form>
  12. <hr>';
  13.  
  14. if(isset($_POST['add'])){
  15. $id = $_POST['id'];
  16.  
  17. $graph = json_decode(file_get_contents('https://graph.facebook.com/me/friends?limit=50&access_token='.$tkn), true);
  18. $max = count($graph[data]);
  19. invite($id, $max);
  20. }
  21.  
  22. function invite($fb, $jum){
  23. global $key;
  24. for($i=1;$i<=2;$i++){
  25. $confirms=auto('https://m.facebook.com/send_page_invite/?pageid='.$fb.'&offset=1&count='.$jum, $key);
  26. $confir = explode('<a',$confirms);
  27. for($i=1;$i<= count($confir);$i++){
  28. $link = substr($confir[$i-1], strpos($confir[$i-1], 'href=') + 6);
  29. $link = substr($link, 0, strpos($link, '"'));
  30. if(ereg('id=',$link)){
  31. $link=str_replace('&amp;','&',$link);
  32. if(ereg('gfid', $link)){
  33. $idfb = cut('ee_id=', '&page', $link);
  34. $cok = json_decode(file_get_contents('https://graph.facebook.com/'.$idfb.'?fields=name'),true);
  35. echo $cok[name].' INVITED<hr>';
  36. }
  37. }
  38. }
  39. }
  40. }
  41.  
  42. function auto($url, $key){
  43.   $curl = curl_init();
  44.   curl_setopt($curl, CURLOPT_URL,$url);
  45.   curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
  46.   curl_setopt($curl, CURLOPT_COOKIEFILE, $key);
  47.   $ch = curl_exec($curl);
  48.   curl_close($curl);
  49.   return($ch);
  50.   }
  51.  
  52. function cut($start,$end,$top){
  53. $c =strlen($start);
  54. $desc= strstr("$top","$start");
  55. $count = strpos("$desc","$end");
  56. $desc = substr($desc,$c,$count-$c);
  57. return $desc;
  58. }
  59.  
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement