From f4c3c399ce62902b2c03800aa575377b7641b276 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Sat, 1 Mar 2014 00:47:12 +0400 Subject: [PATCH] decode special chars --- habr_twister.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/habr_twister.php b/habr_twister.php index 6a7d261..c635d35 100644 --- a/habr_twister.php +++ b/habr_twister.php @@ -22,6 +22,8 @@ $db = new HabrRSSDb('habr_db.dat'); foreach ($rss->channel->item as $item) { $link = (string)$item->link; $title = (string)$item->title; + // Note: habrahabr.ru does both special chars encoding and CDATA wrap + $title = htmlspecialchars_decode($title); // get post id from link $id = (int)preg_replace('#[^\d]#', '', $link);