Skip to content

Instantly share code, notes, and snippets.

@VictorFursa
Last active January 19, 2016 13:59
Show Gist options
  • Select an option

  • Save VictorFursa/6e79558d7e3506e3c3d7 to your computer and use it in GitHub Desktop.

Select an option

Save VictorFursa/6e79558d7e3506e3c3d7 to your computer and use it in GitHub Desktop.
<?php
include "Curl.php";
class Kinopoisk{
private $refer = 'http://www.kinopoisk.ru/';
private $loginUrl = "http://www.kinopoisk.ru/login/";
private $curl;
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();
$curl->close();
}
function getPage($url){
$this->curl = curl_init($url);
curl_setopt($this->curl, CURLOPT_URL,$url);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($this->curl, CURLOPT_REFERER, $url);
$out = curl_exec($this->curl);
echo $out;
}
}
$Kino = new Kinopoisk('Zir4onah', '540919zir');
$Kino ->getPage('http://www.kinopoisk.ru/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment