Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
vkontakte.ru сменено на vk.com
Browse files Browse the repository at this point in the history
  • Loading branch information
saippuakauppias committed Feb 4, 2012
1 parent 97e208f commit f03a30c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions classes/vk_poster.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function print_last_error()

private function need_auth()
{
$result = $this->minicurl->get_file('http://vkontakte.ru/settings');
$result = $this->minicurl->get_file('http://vk.com/settings');
$this->sleep();
return strpos($result, 'HTTP/1.1 302 Found') !==FALSE;
}
Expand All @@ -167,14 +167,14 @@ private function auth()
return FALSE;
}

$this->minicurl->set_cookies('remixsid=' . $sid . '; path=/; domain=.vkontakte.ru');
$this->minicurl->set_cookies('remixsid=' . $sid . '; path=/; domain=.vk.com');

return TRUE;
}

private function get_auth_location()
{
$html = $this->minicurl->get_file('http://vkontakte.ru/');
$html = $this->minicurl->get_file('http://vk.com/');
preg_match('#<input type="hidden" name="ip_h" value="([a-z0-9]*?)" \/>#isU', $html, $matches);

$post = array(
Expand All @@ -184,13 +184,13 @@ private function get_auth_location()
'captcha_sid' => '',
'email' => $this->email,
'expire' => '',
'from_host' => 'vkontakte.ru',
'from_host' => 'vk.com',
'ip_h' => (isset($matches[1]) ? $matches[1]: ''),
'pass' => $this->pwd,
'q' => '1',
);

$auth = $this->minicurl->get_file('http://login.vk.com/?act=login', $post, 'http://vkontakte.ru/');
$auth = $this->minicurl->get_file('http://login.vk.com/?act=login', $post, 'http://vk.com/');
preg_match('#Location\: ([^\r\n]+)#is', $auth, $match);

$this->sleep();
Expand Down Expand Up @@ -229,7 +229,7 @@ private function post_to_wall_query($hash, $to_id, $message, $official=FALSE, $f
'type' => $type,
);

$result = $this->minicurl->get_file('http://vkontakte.ru/al_wall.php', $post);
$result = $this->minicurl->get_file('http://vk.com/al_wall.php', $post);

$this->sleep();
preg_match('#>\d<!>\d+<!>([\d]+)<!>#isU', $result, $match);
Expand All @@ -239,13 +239,13 @@ private function post_to_wall_query($hash, $to_id, $message, $official=FALSE, $f

private function get_hash($page_id)
{
$result = $this->minicurl->get_file('http://vkontakte.ru/' . $page_id);
$result = $this->minicurl->get_file('http://vk.com/' . $page_id);
$this->sleep();

preg_match('#Location\: ([^\r\n]+)#is', $result, $match);
if (isset($match[1]) AND !empty($match[1]))
{
$result = $this->minicurl->get_file('http://vkontakte.ru' . $match[1]);
$result = $this->minicurl->get_file('http://vk.com' . $match[1]);
$this->sleep();
unset($match);

Expand All @@ -260,15 +260,15 @@ private function get_hash($page_id)
'to' => $match[2]
);

$result = $this->minicurl->get_file('http://vkontakte.ru/login.php', $post);
$result = $this->minicurl->get_file('http://vk.com/login.php', $post);
$this->sleep();
unset($match);

preg_match('#>/([a-z0-9\.\-_]+)<#is', $result, $match);

if (isset($match[1]) AND !empty($match[1]))
{
$result = $this->minicurl->get_file('http://vkontakte.ru/' . $match[1]);
$result = $this->minicurl->get_file('http://vk.com/' . $match[1]);
$this->sleep();
unset($match);
}
Expand Down

0 comments on commit f03a30c

Please sign in to comment.