Advertisement
Guest User

Untitled

a guest
Sep 11th, 2010
1,464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <?php
  2. define("ACC_NAME", "bouncer222");
  3. define("ACC_PASS", "PASSWORDHERE");
  4. define("GROUP_ID", "103582791430981168"); // open steam group page and see "Enter chat room" link, which contains ID
  5. define("MY_STEAM_ID", "STEAM_0:0:35005283"); // steam ID which can invite to join group
  6.  
  7. $invite_steam_id = $_GET['i'];
  8.  
  9. $ids = file('invited_ids.txt');
  10. foreach($ids as $id) {
  11. $id = trim($id);
  12. if ( $id == $invite_steam_id )
  13. die($id .": Already invited!\n");
  14. }
  15.  
  16. function GetFriendID( $steam_id ) {
  17. if ( !$steam_id )
  18. return 0;
  19. $auth = explode(':', $steam_id);
  20. if ( !$auth[2] )
  21. return 0;
  22. $fid = gmp_init($auth[2]);
  23. $fid = gmp_mul($fid, "2");
  24. $fid = gmp_add($fid, "76561197960265728");
  25. $fid = gmp_add($fid, $auth[1]);
  26. return gmp_strval($fid);
  27. }
  28.  
  29.  
  30. require_once "HTTP/Request.php";
  31.  
  32. $req = &new HTTP_Request('https://steamcommunity.com');
  33. $req->setMethod(HTTP_REQUEST_METHOD_POST);
  34.  
  35. $req->addPostData("action", "doLogin");
  36. $req->addPostData("goto", "");
  37.  
  38. $req->addPostData("steamAccountName", ACC_NAME);
  39. $req->addPostData("steamPassword", ACC_PASS);
  40.  
  41. echo "Login: ";
  42.  
  43. $res = $req->sendRequest();
  44. if (PEAR::isError($res))
  45. die($res->getMessage());
  46.  
  47. $cookies = $req->getResponseCookies();
  48. if ( !$cookies )
  49. die("fail!\n");
  50.  
  51. echo "ok\n";
  52.  
  53. foreach($cookies as $cookie)
  54. $req->addCookie($cookie['name'],$cookie['value']);
  55.  
  56. $mid = GetFriendID(MY_STEAM_ID);
  57. $fid = GetFriendID($invite_steam_id);
  58. $url = "
  59. http://steamcommunity.com/actions/GroupInvite?type=groupInvite&inviter=$mid&invitee=$fid&group=";GROUP_ID;
  60.  
  61. echo "Inviting $invite_steam_id ($fid): ";
  62. $req->setMethod(HTTP_REQUEST_METHOD_GET);
  63. $req->setUrl($url);
  64.  
  65. $res = $req->sendRequest();
  66. if (PEAR::isError($res))
  67. die($res->getMessage());
  68.  
  69. $data = $req->getResponseBody();
  70. preg_match("/CDATA\[([^\]]+)\]/", $data, $matches);
  71. echo $matches[1] . "\n";
  72. if ( $matches[1] == "OK" )
  73. file_put_contents('invited_ids.txt', $invite_steam_id . "\n",
  74. FILE_APPEND);
  75. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement