Вход Регистрация
Файл: pars_new.php
Строк: 39
<?php

set_time_limit
(100);

include 
'connect.php';

$nick_on_page 12;

$html file_get_contents('http://nasimke.ru/users/index/last-online/people');
$html iconv("utf-8""windows-1251"$html);

preg_match_all("/<a href="/users/index/last-online/people(.*)">(.*)</a>/si"$html$res);

$online $res[2][0];
$pages intval($online $nick_on_page);

$i 1;
while (
$i <= $pages) {
 
$html_page file_get_contents('http://nasimke.ru/users/index/last-online/people?page=' $i);
 
$html_page iconv("utf-8""windows-1251"$html_page);
 
 
$_source explode('<b>На сайте</b>'$html_page);
 
$_source explode('<div class="pager">'$_source[1]);
 
$_source explode('</div>'$_source[0]);
 
 
$ii 1;
 while (
$ii <= $nick_on_page) {
  
preg_match_all("/</a>(.*)<a href="/sim(.*)?sim=(.*)">(.*)</a>/si"$_source[$ii], $res);
  
$username trim($res[4][0]) . '@nasimke.ru';
  
  
mysql_query("INSERT INTO `p_users` (`id`, `mail`) VALUES (NULL, '$username');");
  
  
$ii++;
 }
 
 
$i++;
}

echo 
"Спарсено $online пользователей онлайн";

?>
Онлайн: 1
Реклама