PHP
17
Вклад в тег
<?
require_once 'phpQuery.php';
$url = 'http://ruforum.mt5.com/threads/2494-obzor-valyutnogo-rinka-za-nedelyu';
$userName = 'almostsuper';
$htmlPage = file_get_contents($url);
$html = phpQuery::newDocument($htmlPage);
$posts = $html->find('.postdetails');
foreach ($posts as $var) {
$userPost = pq($var)->find('.username > strong:contains('.$userName.')');
if($userPost->text()==$userName)
{
echo '<h1>'.$userName.'</h1>';
$postBody = pq($var)->find('.postbody');
echo $postBody.'<hr/>';
}
}