Introducción a Zend Framework

 Aprendiendo Zend Framework

Apéndice

 Referencia de Zend Framework


  • Zend_Gdata
  • Zend_Http
  • Zend_InfoCard
  • Zend_Json
  • Zend_Layout
  • Zend_Ldap
  • Zend_Loader
  • Zend_Locale
  • Zend_Log
  • Zend_Mail
  • Zend_Markup
  • Zend_Measure
  • Zend_Memory
  • Zend_Mime
  • Zend_Navigation
  • Zend_Oauth
  • Zend_OpenId
  • Zend_Paginator
  • Zend_Pdf
  • Zend_ProgressBar
  • Zend_Queue
  • Zend_Reflection
  • Zend_Registry
  • Zend_Rest

  • Zend_Search_Lucene
  • Zend_Serializer
  • Zend_Server
  • Zend_Service
  • Zend_Session
  • Zend_Soap
  • Zend_Tag
  • Zend_Test
  • Zend_Text
  • Zend_TimeSync
  • Zend_Tool
  • Zend_Tool_Framework
  • Zend_Tool_Project
  • Zend_Translate
  • Zend_Uri
  • Zend_Validate
  • Zend_Version
  • Zend_View
  • Zend_Wildfire
  • Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Traducción al 26.9% - Actualizado el 2011-11-16 - Revisión 24249 - Versión ZF 1.11.x

    63.39. Zend_Service_Yahoo

    63.39.1. Introduction

    Zend_Service_Yahoo is a simple API for using many of the Yahoo! REST APIs. Zend_Service_Yahoo allows you to search Yahoo! Web search, Yahoo! News, Yahoo! Local, Yahoo! Images. In order to use the Yahoo! REST API, you must have a Yahoo! Application ID. To obtain an Application ID, please complete and submit the Application ID Request Form.

    63.39.2. Searching the Web with Yahoo!

    Zend_Service_Yahoo enables you to search the Web with Yahoo! using the webSearch() method, which accepts a string query parameter and an optional second parameter as an array of search options. For full details and an option list, please visit the Yahoo! Web Search Documentation. The webSearch() method returns a Zend_Service_Yahoo_WebResultSet object.

    Ejemplo 63.221. Searching the Web with Yahoo!

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->webSearch('PHP');
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.3. Finding Images with Yahoo!

    You can search for Images with Yahoo using Zend_Service_Yahoo's imageSearch() method. This method accepts a string query parameter and an optional array of search options, as for the webSearch() method. For full details and an option list, please visit the Yahoo! Image Search Documentation.

    Ejemplo 63.222. Finding Images with Yahoo!

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->imageSearch('PHP');
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.4. Finding videos with Yahoo!

    You can search for videos with Yahoo using Zend_Service_Yahoo's videoSearch() method. For full details and an option list, please visit the Yahoo! Video Search Documentation.

    Ejemplo 63.223. Finding videos with Yahoo!

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->videoSearch('PHP');
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.5. Finding Local Businesses and Services with Yahoo!

    You can search for local businesses and services with Yahoo! by using the localSearch() method. For full details, please see the Yahoo! Local Search Documentation.

    Ejemplo 63.224. Finding Local Businesses and Services with Yahoo!

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->localSearch('Apple Computers', array('zip' => '95014'));
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.6. Searching Yahoo! News

    Searching Yahoo! News is simple; just use the newsSearch() method, as in the following example. For full details, please see the Yahoo! News Search Documentation.

    Ejemplo 63.225. Searching Yahoo! News

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->newsSearch('PHP');
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.7. Searching Yahoo! Site Explorer Inbound Links

    Searching Yahoo! Site Explorer Inbound Links is simple; just use the inlinkDataSearch() method, as in the following example. For full details, please see the Yahoo! Site Explorer Inbound Links Documentation.

    Ejemplo 63.226. Searching Yahoo! Site Explorer Inbound Links

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->inlinkDataSearch('http://framework.zend.com/');
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.8. Searching Yahoo! Site Explorer's PageData

    Searching Yahoo! Site Explorer's PageData is simple; just use the pageDataSearch() method, as in the following example. For full details, please see the Yahoo! Site Explorer PageData Documentation.

    Ejemplo 63.227. Searching Yahoo! Site Explorer's PageData

    $yahoo = new Zend_Service_Yahoo("YAHOO_APPLICATION_ID");
    $results $yahoo->pageDataSearch('http://framework.zend.com/');
    foreach (
    $results as $result) {
        echo 
    $result->Title .'<br />';
    }

    63.39.9. Zend_Service_Yahoo Classes

    The following classes are all returned by the various Yahoo! searches. Each search type returns a type-specific result set which can be easily iterated, with each result being contained in a type result object. All result set classes implement the SeekableIterator interface, allowing for easy iteration and seeking to a specific result.

    63.39.9.1. Zend_Service_Yahoo_ResultSet

    Each of the search specific result sets is extended from this base class.

    Each of the specific result sets returns a search specific Zend_Service_Yahoo_Result objects.

    63.39.9.1.1. Zend_Service_Yahoo_ResultSet::totalResults()

    int totalResults();

    Returns the number of results returned for the search.

    63.39.9.1.2. Properties

    Tabla 63.20. Zend_Service_Yahoo_ResultSet

    Name Type Description
    totalResultsAvailable int Total number of results found.
    totalResultsReturned int Number of results in the current result set
    firstResultPosition int Position of the first result in this set relative to the total number of results.

    Back to Class List

    63.39.9.2. Zend_Service_Yahoo_WebResultSet

    Zend_Service_Yahoo_WebResultSet represents a Yahoo! Web Search result set.

    [Nota] Nota

    Zend_Service_Yahoo_WebResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.3. Zend_Service_Yahoo_ImageResultSet

    Zend_Service_Yahoo_ImageResultSet represents a Yahoo! Image Search result set.

    [Nota] Nota

    Zend_Service_Yahoo_ImageResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.4. Zend_Service_Yahoo_VideoResultSet

    Zend_Service_Yahoo_VideoResultSet represents a Yahoo! Video Search result set.

    [Nota] Nota

    Zend_Service_Yahoo_VideoResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.5. Zend_Service_Yahoo_LocalResultSet

    Zend_Service_Yahoo_LocalResultSet represents a Yahoo! Local Search result set.

    Tabla 63.21. Zend_Service_Yahoo_LocalResultSet Properties

    Name Type Description
    resultSetMapURL string The URL of a webpage containing a map graphic with all returned results plotted on it.

    [Nota] Nota

    Zend_Service_Yahoo_LocalResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.6. Zend_Service_Yahoo_NewsResultSet

    Zend_Service_Yahoo_NewsResultSet represents a Yahoo! News Search result set.

    [Nota] Nota

    Zend_Service_Yahoo_NewsResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.7. Zend_Service_Yahoo_InlinkDataResultSet

    Zend_Service_Yahoo_InlinkDataResultSet represents a Yahoo! Inbound Link Search result set.

    [Nota] Nota

    Zend_Service_Yahoo_InlinkDataResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.8. Zend_Service_Yahoo_PageDataResultSet

    Zend_Service_Yahoo_PageDataResultSet represents a Yahoo! PageData Search result set.

    [Nota] Nota

    Zend_Service_Yahoo_PageDataResultSet extends Zend_Service_Yahoo_ResultSet

    Back to Class List

    63.39.9.9. Zend_Service_Yahoo_Result

    Each of the search specific results is extended from this base class.

    63.39.9.9.1. Properties

    Tabla 63.22. Zend_Service_Yahoo_Result Properties

    Name Type Description
    Title string Title of the Result item
    Url string The URL of the result item
    ClickUrl string The URL for linking to the result item

    Back to Class List

    63.39.9.10. Zend_Service_Yahoo_WebResult

    Each Web Search result is returned as a Zend_Service_Yahoo_WebResult object.

    63.39.9.10.1. Properties

    Tabla 63.23. Zend_Service_Yahoo_WebResult Properties

    Name Type Description
    Summary string Result summary
    MimeType string Result MIME type
    ModificationDate string The last modification date of the result as a UNIX timestamp.
    CacheUrl string Yahoo! web cache URL for the result, if it exists.
    CacheSize int The size of the Cache entry

    Back to Class List

    63.39.9.11. Zend_Service_Yahoo_ImageResult

    Each Image Search result is returned as a Zend_Service_Yahoo_ImageResult object.

    63.39.9.11.1. Properties

    Tabla 63.24. Zend_Service_Yahoo_ImageResult Properties

    Name Type Description
    Summary string Result summary
    RefererUrl string The URL of the page which contains the image
    FileSize int The size of the image file in bytes
    FileFormat string The format of the image (bmp, gif, jpeg, png, etc.)
    Height int The height of the image
    Width int The width of the image
    Thumbnail Zend_Service_Yahoo_Image Image thumbnail

    Back to Class List

    63.39.9.12. Zend_Service_Yahoo_VideoResult

    Each Video Search result is returned as a Zend_Service_Yahoo_VideoResult object.

    63.39.9.12.1. Properties

    Tabla 63.25. Zend_Service_Yahoo_VideoResult Properties

    Name Type Description
    Summary string Result summary
    RefererUrl string The URL of the page which contains the video
    FileSize int The size of the video file in bytes
    FileFormat string The format of the video (avi, flash, mpeg, msmedia, quicktime, realmedia, etc.)
    Height int The height of the video in pixels
    Width int The width of the video in pixels
    Duration int The length of the video in seconds
    Channels int Number of audio channels in the video
    Streaming boolean Whether the video is streaming or not
    Thumbnail Zend_Service_Yahoo_Image Image thumbnail

    Back to Class List

    63.39.9.13. Zend_Service_Yahoo_LocalResult

    Each Local Search result is returned as a Zend_Service_Yahoo_LocalResult object.

    63.39.9.13.1. Properties

    Tabla 63.26. Zend_Service_Yahoo_LocalResult Properties

    Name Type Description
    Address string Street Address of the result
    City string City in which the result resides in
    State string State in which the result resides in
    Phone string Phone number for the result
    Rating int User submitted rating for the result
    Distance float The distance to the result from your specified location
    MapUrl string A URL of a map for the result
    BusinessUrl string The URL for the business website, if known
    BusinessClickUrl string The URL for linking to the business website, if known

    Back to Class List

    63.39.9.14. Zend_Service_Yahoo_NewsResult

    Each News Search result is returned as a Zend_Service_Yahoo_NewsResult object.

    63.39.9.14.1. Properties

    Tabla 63.27. Zend_Service_Yahoo_NewsResult Properties

    Name Type Description
    Summary string Result summary
    NewsSource string The company who distributed the article
    NewsSourceUrl string The URL for the company who distributed the article
    Language string The language the article is in
    PublishDate string The date the article was published as a UNIX timestamp
    ModificationDate string The date the article was last modified as a UNIX timestamp
    Thumbnail Zend_Service_Yahoo_Image Image Thumbnail for the article, if it exists

    Back to Class List

    63.39.9.15. Zend_Service_Yahoo_InlinkDataResult

    Each Inbound Link Search result is returned as a Zend_Service_Yahoo_InlinkDatabResult object.

    Back to Class List

    63.39.9.16. Zend_Service_Yahoo_PageDataResult

    Each Page Data Search result is returned as a Zend_Service_Yahoo_PageDatabResult object.

    Back to Class List

    63.39.9.17. Zend_Service_Yahoo_Image

    All images returned either by the Yahoo! Image Search or the Yahoo! News Search are represented by Zend_Service_Yahoo_Image objects

    63.39.9.17.1. Properties

    Tabla 63.28. Zend_Service_Yahoo_Image Properties

    Name Type Description
    Url string Image URL
    Width int Image Width
    Height int Image Height

    Back to Class List

    digg delicious meneame google twitter technorati facebook

    Comentarios

    Loading...