Advertisement
Guest User

opo seng salah

a guest
Mar 5th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <?
  2. $username="email@gmail.com";
  3. $password="passemail";
  4. $url="http://www.goodreads.com";
  5. $cookie="cookie.txt";
  6. $user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6";
  7.  
  8. $postdata = "user_email=". $username ."&user_password=". $password;
  9. $ch = curl_init();
  10. curl_setopt ($ch, CURLOPT_URL, $url . "/user/sign_in");
  11. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  12. curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
  13. curl_setopt ($ch, CURLOPT_TIMEOUT, 4564524245260);
  14. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  15. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  16. curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
  17. //curl_setopt($ch,CURLOPT_COOKIEFILE, $cookie);
  18. curl_setopt ($ch, CURLOPT_REFERER, 'http://google.com');
  19. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  20. curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
  21. curl_setopt ($ch, CURLOPT_POST, 1);
  22. curl_setopt($ch, CURLOPT_HEADER, true);
  23.  
  24. $result = curl_exec ($ch);
  25. curl_close($ch);
  26. echo $result;
  27.  
  28. $ch = curl_init('https://www.goodreads.com/shelf/show/contemporary?page=7');
  29. //curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
  30. curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
  31. curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie);
  32. curl_setopt ($ch, CURLOPT_COOKIESESSION, 1);
  33. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
  34. curl_setopt($ch, CURLOPT_HEADER, true);
  35.  
  36. $res = curl_exec ($ch);
  37. curl_close($ch);
  38. echo $res;
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement