Advertisement
Guest User

Untitled

a guest
Jul 12th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. $username = "user";
  2. $password = "pass";
  3.  
  4. $url = "http://myanimelist.net/anime/".$mal_id;
  5.  
  6. $ch = curl_init();
  7. curl_setopt($ch, CURLOPT_URL, $url);
  8. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
  9. curl_setopt($ch, CURLOPT_HEADER, 1);
  10. curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
  11. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  12. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0");
  13. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  14. $return = curl_exec($ch);
  15. echo $return;
  16. $info = curl_getinfo($ch);
  17. flush();
  18. curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement