Example #1
0
 public function searchPhotos($query, $limit = 10)
 {
     $query = "select * from flickr.photos.search where text=\"{$query}\" limit {$limit}";
     $yql = new YQL($query);
     $res = $yql->execute()->results->photo;
     $ret = array();
     foreach ($res as $ph) {
         $ret[] = new FlickrPhoto($ph->farm, $ph->id, $ph->owner, $ph->secret, $ph->server, $ph->title);
     }
     return $ret;
 }
Example #2
0
 public function __construct()
 {
     parent::__construct('yahoo.finance.quotes');
 }
 public function __construct()
 {
     parent::__construct('yahoo.finance.historicaldata');
 }
Example #4
0
 /**
  * Coverage page
  *
  * @note Still in development
  */
 public function coverageAction()
 {
     $this->view->threeColumnLayout = true;
     // add this to make sure json output does not get flooded with
     // notices from the YUI library
     error_reporting(0);
     // @todo: override setLayout() where it sets 'customlayout' property so I don't have
     // to remember adding it in the controller
     $this->_helper->layout->assign('customlayout', true);
     $this->_helper->layout->setLayout('tnc2011/coverage');
     $this->view->stylesheet('min-coverage.css');
     // @todo: move this to includes/tnc2011 !
     //$this->view->headLink()->appendStylesheet('/js/prettyPhoto/css/prettyPhoto.css');
     $this->view->headLink()->appendStylesheet('/js/jquery-ui/css/ui-lightness/jquery-ui.css');
     $this->view->headScript()->appendFile('/js/jquery-ui/js/jquery-ui.min.js');
     //$this->view->headScript()->appendFile('/js/prettyPhoto/js/jquery.prettyPhoto.js');
     $this->view->headScript()->appendFile('/js/coverage.js');
     $yql = new YQL();
     $results = $yql->getData();
     $markup = new htmlMarkup($results);
     if (!$this->getRequest()->isXmlHttpRequest()) {
         $this->view->results = $results;
         $this->view->markup = $markup;
     } else {
         $return = array();
         $return['blog'] = $markup->blog();
         $return['twitter'] = $markup->twitter();
         $return['flickr'] = $markup->flickr();
         $return['youtube'] = $markup->youtube();
         echo json_encode($return);
         exit;
     }
 }
Example #5
0
 public function testExtends()
 {
     $parent = new YQL('yahoo.finance.quotes');
     $this->assertEquals($parent->desc()->query->results, $this->yql->desc()->query->results);
 }