$items = $xpath->query('//div[@class="reports"]/div');
foreach($tems as $item)
{
$status = $item->getAttribute('class');
if($status == 'SUCCESS')
{
$name = $xpath->query('./div[@class="name"]', $item);
}else
{
$author = $xpath->query('./div[@class="author"]', $item);
}
}
str_replace("charset='UTF-8'", "charset=UTF-8", $omaURL);
$options = array("indent" => false,
"clean" => true,
"drop-font-tags" => true,
"drop-empty-paras" => true,
"hide-comments" => true,
"show-body-only" => false);
$tidy = new tidy();
$tidy->parseString($omaURL, $options, 'utf8');
$tidy->cleanRepair();
ehco $tidy;
if($command == '/random_question')
{
// собрать ответ с текстом, кнопками, картинкой, чем угодно
// отправить обратно
}