Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = "user";
- $password = "pass";
- $url = "http://myanimelist.net/anime/".$mal_id;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- $return = curl_exec($ch);
- echo $return;
- $info = curl_getinfo($ch);
- flush();
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement