$url = 'http://www.aphorism.ru/rss/aphorismnew.xml';
$hndl = fopen($url, 'r');
$contents = '';
while (!feof($hndl)) {
$contents .= fread($hndl, 8192);
}
fclose($hndl);
preg_match_all("/
(.*?)<\/title>/", $contents, $titles, PREG_PATTERN_ORDER);
preg_match_all("/(.*?)<\/description>/", $contents, $desc, PREG_PATTERN_ORDER);
$i=rand(0, count($titles[1]));
$desc[1][$i]=str_replace('
', chr(13), $desc[1][$i]);
comm_msg('main', htmlspecialchars_decode($desc[1][$i]));
?>