|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00027 require_once 'Zend/Date.php'; 00028 00032 require_once 'Zend/Service/Technorati/ResultSet.php'; 00033 00037 require_once 'Zend/Service/Technorati/Utils.php'; 00038 00039 00049 class Zend_Service_Technorati_DailyCountsResultSet extends Zend_Service_Technorati_ResultSet 00050 { 00057 protected $_searchUrl; 00058 00065 protected $_days; 00066 00073 public function __construct(DomDocument $dom, $options = array()) 00074 { 00075 parent::__construct($dom, $options); 00076 00077 // default locale prevent Zend_Date to fail 00078 // when script is executed via shell 00079 // Zend_Locale::setDefault('en'); 00080 00081 $result = $this->_xpath->query('/tapi/document/result/days/text()'); 00082 if ($result->length == 1) $this->_days = (int) $result->item(0)->data; 00083 00084 $result = $this->_xpath->query('/tapi/document/result/searchurl/text()'); 00085 if ($result->length == 1) { 00086 $this->_searchUrl = Zend_Service_Technorati_Utils::normalizeUriHttp($result->item(0)->data); 00087 } 00088 00089 $this->_totalResultsReturned = (int) $this->_xpath->evaluate("count(/tapi/document/items/item)"); 00090 $this->_totalResultsAvailable = (int) $this->getDays(); 00091 } 00092 00093 00099 public function getSearchUrl() { 00100 return $this->_searchUrl; 00101 } 00102 00108 public function getDays() { 00109 return $this->_days; 00110 } 00111 00117 public function current() 00118 { 00122 require_once 'Zend/Service/Technorati/DailyCountsResult.php'; 00123 return new Zend_Service_Technorati_DailyCountsResult($this->_results->item($this->_currentIndex)); 00124 } 00125 }