diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Service/Technorati/DailyCountsResultSet.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Service/Technorati/DailyCountsResultSet.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,125 @@ +_xpath->query('/tapi/document/result/days/text()'); + if ($result->length == 1) $this->_days = (int) $result->item(0)->data; + + $result = $this->_xpath->query('/tapi/document/result/searchurl/text()'); + if ($result->length == 1) { + $this->_searchUrl = Zend_Service_Technorati_Utils::normalizeUriHttp($result->item(0)->data); + } + + $this->_totalResultsReturned = (int) $this->_xpath->evaluate("count(/tapi/document/items/item)"); + $this->_totalResultsAvailable = (int) $this->getDays(); + } + + + /** + * Returns the search URL for given query. + * + * @return Zend_Uri_Http + */ + public function getSearchUrl() { + return $this->_searchUrl; + } + + /** + * Returns the number of days for which counts provided. + * + * @return int + */ + public function getDays() { + return $this->_days; + } + + /** + * Implements Zend_Service_Technorati_ResultSet::current(). + * + * @return Zend_Service_Technorati_DailyCountsResult current result + */ + public function current() + { + /** + * @see Zend_Service_Technorati_DailyCountsResult + */ + require_once 'Zend/Service/Technorati/DailyCountsResult.php'; + return new Zend_Service_Technorati_DailyCountsResult($this->_results->item($this->_currentIndex)); + } +}