Last active
January 19, 2016 15:07
-
-
Save VictorFursa/ee27980ea4152792c3fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include "Curl.php"; | |
| class Kinopoisk{ | |
| private $refer = 'http://www.kinopoisk.ru/'; | |
| private $loginUrl = "http://www.kinopoisk.ru/login/"; | |
| function __construct($username, $password){ | |
| $curl = new Curl($this->loginUrl); | |
| $curl->setRefer($this->refer); | |
| $formData = array( | |
| "shop_user" => array( | |
| "login" => $username, | |
| "pass" => $password, | |
| "mem" => "on" | |
| ), | |
| "auth"=>"войти на сайт"); | |
| $curl->setReturnTransfer(true); | |
| $curl->sendPostForm($formData); | |
| $curl->exec(); | |
| echo curl_getinfo($curl, CURLINFO_HEADER_OUT ); | |
| $curl->close(); | |
| } | |
| function getPage($url){ | |
| $curl = curl_init($url); | |
| curl_setopt($curl, CURLOPT_URL,$url); | |
| curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); | |
| curl_setopt($curl, CURLOPT_REFERER, $url); | |
| $out = curl_exec($curl); | |
| return $out; | |
| } | |
| } | |
| $Kino = new Kinopoisk('Zir4onah', '540919zir'); | |
| echo $Kino->getPage('http://www.kinopoisk.ru/'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment