diff --git a/habr_twister.php b/habr_twister.php index 04fce8a..1faf32b 100644 --- a/habr_twister.php +++ b/habr_twister.php @@ -4,9 +4,10 @@ mb_internal_encoding('UTF-8'); setlocale(LC_CTYPE, 'en_US.UTF-8'); // Load RSS feed +require_once 'rssreader.php'; $feed_uri = 'http://habrahabr.ru/rss/hubs/new/'; -$rss = simplexml_load_file($feed_uri); -if (!$rss) die('Cannot read rss'); +$rss = getRssFeed($feed_uri); +if (!$rss) die('Cannot read rss or it is up to date'); // Initialise TwisterPost require_once 'twisterpost.php'; diff --git a/rssreader.php b/rssreader.php new file mode 100644 index 0000000..2ccf857 --- /dev/null +++ b/rssreader.php @@ -0,0 +1,53 @@ +