Advertisement
fattwam

LastWoW Voting script

Jan 27th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <?php
  2.  
  3. $username = 'USERNAME';
  4. $password = 'PASSWORD';
  5.  
  6. $post_data = 'account='.$username.'&pass='.$password.'&login=Login';
  7.  
  8. $login_url = 'http://www.lastwow.com/login.action.php';
  9.  
  10. $url1 = 'http://www.lastwow.com/vote.wow?num=1';
  11. $url2 = 'http://www.lastwow.com/vote.wow?num=2';
  12. $url3 = 'http://www.lastwow.com/vote.wow?num=3';
  13.  
  14.  
  15. //Create a curl object
  16. $ch = curl_init();
  17.  
  18. //Set the useragent
  19. $agent = $_SERVER["HTTP_USER_AGENT"];
  20. curl_setopt($ch, CURLOPT_USERAGENT, $agent);
  21.  
  22. //Set the URL
  23. curl_setopt($ch, CURLOPT_URL, $login_url );
  24.  
  25. //This is a POST query
  26. curl_setopt($ch, CURLOPT_POST, 1 );
  27.  
  28. //Set the post data
  29. curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  30.  
  31. //We want the content after the query
  32. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  33.  
  34. //Follow Location redirects
  35. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  36.  
  37. /*
  38. Set the cookie storing files
  39. Cookie files are necessary since we are logging and session data needs to be saved
  40. */
  41.  
  42. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  43. curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  44.  
  45. //Execute the action to login
  46. $postResult = curl_exec($ch);
  47.  
  48. curl_setopt($ch, CURLOPT_URL, $url1);
  49. curl_exec($ch);
  50.  
  51. curl_setopt($ch, CURLOPT_URL, $url2);
  52. curl_exec($ch);
  53.  
  54. curl_setopt($ch, CURLOPT_URL, $url3);
  55. curl_exec($ch);
  56.  
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement