From ff648fb80a91d22f26a49d981e90068b2b47adcb Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sun, 19 Jan 2014 22:41:29 +0000 Subject: [PATCH] 1. Dodanie podstawowej obsługi kanałów formacie Atom (m.in. Onet.pl). 2. Opisanie sposobu rejestracji w serwicie GeoNames (skrypt pogody). --- data/tv/wp_parse.php | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/data/tv/wp_parse.php b/data/tv/wp_parse.php index 983e4cc..716f2df 100644 --- a/data/tv/wp_parse.php +++ b/data/tv/wp_parse.php @@ -37,7 +37,7 @@ } $this->context = $context->item(0); - $name = $this->xpath->query('.//h2[@class="sh2"]//span//text()', $this->context); + $name = $this->xpath->query('.//*[@class="sh2"]//span//text()', $this->context); if($name->length != 1) { throw new Exception('Nie znaleziono nazwy stacji, błędny HTML.'); } @@ -74,8 +74,6 @@ function xmltv($id, $fp) { $program = array(); - ini_set('mbstring.substitute_character', 'none'); - $days_dom = $this->xpath->query('.//ul[@class="lsDay"]//li', $this->context); $days = array(); foreach($days_dom as $day) { @@ -97,11 +95,7 @@ $nazwa = $this->xpath->query('.//h3', $programs)->item(0)->textContent; $opis = $this->xpath->query('.//p', $programs)->item(0)->textContent; - $program[$num][] = array( - $godzina, - mb_convert_encoding($nazwa, 'UTF-8', 'UTF-8'), - mb_convert_encoding($opis, 'UTF-8', 'UTF-8') - ); + $program[$num][] = array($godzina, $nazwa, $opis); } unset($programs_dom, $programs); } -- Gitblit v1.9.1