
14.02.2010, 11:47
|
|
Новичок
Регистрация: 25.09.2008
Сообщений: 28
Провел на форуме: 144800
Репутация:
9
|
|
Получить список всех друзей
PHP код:
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://pda.vkontakte.ru/write');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, 'http://vkontakte.ru/mail.php');
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
$answer=curl_exec($ch);
curl_close($ch);
preg_match_all('#<option value="([0-9]+)" >#UiS',$answer,$base);
массив $base будет содержать id всех друзей, а на счёт аватарки можно в SQL просо занести ссылку на неё...
PHP код:
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://vkontakte.ru/profile.php');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
$answer=curl_exec($ch);
curl_close($ch);
$photo = (preg_match("#<img src=(.*?) #", $answer, $photo)) ? $photo[1] : "fuck" ;
Solker, если ищешь online - то там на странице могут ещё показывать других пользователей которые online, так что достаточно найти строку
Код:
<b>Online</b>
if(strpos($res_curl,'<b>Online</b>'))
Последний раз редактировалось felix_; 14.02.2010 в 11:54..
|
|
|