// RSS2email  v 1.1
//by medar & goarmy

/**
 * Указываем адрес в Yahoo Pipes который генерирует RSS ленту нужных нам постов
 *
 * в данном премере параметры 
 * key кей
 * kolvo количество новостей в рсс ленте
 * но думаю понятно, что нужно делать собственные трубы
 */
$url = 'http://pipes.yahoo.com/pipes/pipe.run?_id=6841b9ab55dcbc0423201c58d8acb3c3&_render=rss&key=viagra&kolvo=1';
/**
 * Адрес почты, через которую наполняется блог 
 */
$email = 'someemail@blogger.com';

$content = file_get_contents($url);
$content = str_replace("\n","",$content);
$match=array();
preg_match("#(.*?)<\/item>#", $content, $match); 
$item = $match[1]; 
$err = preg_match("#(.*?)<\/title>#", $item, $match); 
$title = $match[1]; 
$err = preg_match("#<description>(.*?)<\/description>#", $item, $match); 
$description = $match[1]; 
$subject = $title; 
$message = $description; 
mail($email, $subject, $message); 

</pre>
<script language="javascript"> window.onload = function () {
    dp.SyntaxHighlighter.ClipboardSwf = 'clipboard.swf'; dp.SyntaxHighlighter.HighlightAll('code'); 
} </script>
</body>
</html>