From 4c7016fb3e2dd55de4389872ba5c6c65bbf5a582 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Tue, 27 Nov 2012 15:32:04 +0000
Subject: [PATCH] Poprawka parsowania strony z programem telewizyjnym.

---
 modules/30_pogoda/api_geonames.php |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/30_pogoda/api_geonames.php b/modules/30_pogoda/api_geonames.php
index 6230ad8..39c488e 100644
--- a/modules/30_pogoda/api_geonames.php
+++ b/modules/30_pogoda/api_geonames.php
@@ -23,10 +23,10 @@
 				return FALSE;
 			}
 			
-			// Trzymaj w cache przez około 278 dni
-			$download->cacheFor(1000000);
+			// Trzymaj w cache przez około 116 dni
+			$download->cacheFor(10000000);
 			
-			if($data->geoname[0]->getName() != 'geoname'
+			if((int)$data->totalResultsCount == 0 || $data->geoname->getName() != 'geoname' || $data->geoname[0]->getName() != 'geoname'
 				|| $data->geoname[0]->name->getName() != 'name'
 				|| $data->geoname[0]->countryName->getName() != 'countryName'
 				|| $data->geoname[0]->lat->getName() != 'lat'

--
Gitblit v1.9.1