Changeset 7

Show
Ignore:
Timestamp:
11/27/09 06:56:30 (10 months ago)
Author:
super
Message:
 
Location:
trunk/lib
Files:
2 added
1 removed
5 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/lib/Search/req.Gigablast.php

    r1 r7  
     1<?php 
     2 
     3class GigablastSearch extends HttpRequest { 
     4        public $data; 
     5        public $query; 
     6        public $num = 10; 
     7         
     8        public $url = ''; 
     9         
     10        public function __construct($query) { 
     11                $this->query = $query; 
     12        } 
     13         
     14        protected function before() { 
     15                $this->args['q'] = $this->query; 
     16                $this->args['raw'] = 9; // feed type, 9 = utf8 xml, 8 = plain xml 
     17                $this->args['sc'] = 1; // site clustering 
     18                $this->args['dr'] = 1; // remove duplicate results 
     19        } 
     20         
     21        protected function success() { 
     22                $this->data = new SimpleXMLElement($this->body); 
     23        } 
     24} 
  • trunk/lib/YahooApi/req.YAnswersSearch.php

    r6 r7  
    5555        public function __construct($query,$num=null,$sort=null,$searchIn=null,$type=null) { 
    5656                $this->query = $query; 
    57                 if($num) $this->num = $num; 
    58                 if($sort) $this->sort = $sort; 
    59                 if($searchIn) $this->searchIn = $searchIn; 
    60                 if($type) $this->type = $type; 
    61  
    62                 $this->args['appid'] = $this->getAppId(); 
     57                $this->num = $num; 
     58                $this->sort = $sort; 
     59                $this->searchIn = $searchIn; 
     60                $this->type = $type; 
    6361        } 
    6462 
    6563        protected function before() { 
     64                $this->args['appid'] = $this->getAppId(); 
    6665                $this->args['query'] = $query; 
    6766 
  • trunk/lib/YahooApi/req.YahooApi.php

    r6 r7  
    1313//'bRyF5Z7V34H5q.yCejLKoMm8Nm.U8oNrcuwrtRFiQ6wl1WbbJsXwE.8P0YaOFQ--' 
    1414 
    15         protected $host; 
    16         public $args = array( 
    17                 'appid'=>'', 
    18                 'output'=>'json'); 
     15        public $args = array('output'=>'json'); 
    1916        public $method = 'get'; 
    2017 
     
    2219                return $this->appid; 
    2320        } 
    24  
     21        public function setAppId($str) { 
     22                $this->appid = $str; 
     23        } 
    2524        public function httperror() { 
    2625                $this->keep = false; 
  • trunk/lib/YahooApi/req.YahooSearch.php

    r6 r7  
    3838                $this->number = $number; 
    3939                $this->filter = $filter; 
    40  
    4140        } 
    4241 
     
    7271                        $this->offset += $this->num; 
    7372 
    74                 } 
    75                 if($cl < 1) { 
     73                } else { 
    7674                        $this->keep = false; 
    7775                } 
  • trunk/lib/YahooApi/req.YahooSuggest.php

    r6 r7  
    1717                $this->query = $query; 
    1818                $this->num = $num; 
    19                 $this->args['appid'] = $this->getAppId(); 
     19                 
    2020        } 
    2121        protected function before() { 
     22                $this->args['appid'] = $this->getAppId(); 
    2223                $this->args['query'] = $this->query; 
    2324                $this->args['results'] = $this->num;