Services_Yahoo
[ class tree: Services_Yahoo ] [ index: Services_Yahoo ] [ all elements ]

Source for file web.php

Documentation is available at web.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3.  
  4. /**
  5.  * Web search class
  6.  *
  7.  * Copyright 2005-2006 Martin Jansen
  8.  *
  9.  * Licensed under the Apache License, Version 2.0 (the "License");
  10.  * you may not use this file except in compliance with the License.
  11.  * You may obtain a copy of the License at
  12.  *
  13.  *     http://www.apache.org/licenses/LICENSE-2.0
  14.  *
  15.  * Unless required by applicable law or agreed to in writing, software
  16.  * distributed under the License is distributed on an "AS IS" BASIS,
  17.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18.  * See the License for the specific language governing permissions and
  19.  * limitations under the License.
  20.  *
  21.  * @category   Services
  22.  * @package    Services_Yahoo
  23.  * @author     Martin Jansen <mj@php.net>
  24.  * @copyright  2005-2006 Martin Jansen
  25.  * @license    http://www.apache.org/licenses/LICENSE-2.0  Apache License, Version 2.0
  26.  * @version    CVS: $Id: web.php,v 1.11 2007/04/20 17:43:58 mj Exp $
  27.  * @link       http://pear.php.net/package/Services_Yahoo
  28.  */
  29.  
  30. require_once "AbstractSearch.php";
  31.  
  32. /**
  33.  * Web search class
  34.  *
  35.  * This class implements an interface to Yahoo's web search by using
  36.  * the Yahoo API.
  37.  *
  38.  * @category   Services
  39.  * @package    Services_Yahoo
  40.  * @author     Martin Jansen <mj@php.net>
  41.  * @copyright  2005-2006 Martin Jansen
  42.  * @license    http://www.apache.org/licenses/LICENSE-2.0  Apache License, Version 2.0
  43.  * @version    CVS: $Id: web.php,v 1.11 2007/04/20 17:43:58 mj Exp $
  44.  * @link       http://pear.php.net/package/Services_Yahoo
  45.  * @link       http://developer.yahoo.net/web/V1/webSearch.html
  46.  */
  47.  
  48.     protected $requestURL = "http://api.search.yahoo.com/WebSearchService/V1/webSearch";
  49.  
  50.     /**
  51.      * Set to allow multiple results with similar content
  52.      *
  53.      * @access public
  54.      * @return Services_Yahoo_AbstractSearch Object which contains the method
  55.      */
  56.     public function includeSimilar()
  57.     {
  58.         $this->parameters['similar_ok'= 1;
  59.  
  60.         return $this;
  61.     }
  62.  
  63.     /**
  64.      * Set the language the results are written in
  65.      *
  66.      * A list of supported languages can be found on
  67.      * http://developer.yahoo.net/documentation/languages.html.
  68.      *
  69.      * @link   http://developer.yahoo.net/documentation/languages.html
  70.      * @access public
  71.      * @param  string Language code
  72.      * @return Services_Yahoo_AbstractSearch Object which contains the method
  73.      */
  74.     public function inLanguage($language)
  75.     {
  76.         $this->parameters['language'$language;
  77.  
  78.         return $this;
  79.     }
  80.  
  81.     /**
  82.      * Sets the domains to restrict the search to
  83.      *
  84.      * @access public
  85.      * @param  string Domain
  86.      * @return Services_Yahoo_AbstractSearch Object which contains the method
  87.      */
  88.     public function onSite($site{
  89.         $this->parameters['site'][$site;
  90.  
  91.         return $this;
  92.     }
  93.  
  94.     /**
  95.      * Sets the subscriptions to premium contents that should also be searched
  96.      *
  97.      * @access public
  98.      * @param  string Subscription code
  99.      * @return Services_Yahoo_AbstractSearch Object which contains the method
  100.      */    
  101.     public function withSubscription($subscription{
  102.         $this->parameters['subscription'][$subscription;
  103.  
  104.         return $this;
  105.     }
  106.  
  107.     /**
  108.      * Sets the Creative Commons licenses that the contents must be licensed under
  109.      *
  110.      * @access public
  111.      * @param  string Creative Commons License code
  112.      * @return Services_Yahoo_AbstractSearch Object which contains the method
  113.      */
  114.     public function withLicense($license{
  115.         $this->parameters['license'][$license;
  116.  
  117.         return $this;
  118.     }
  119. }

Documentation generated on Fri, 20 Apr 2007 14:30:09 -0400 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.