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.21. Zend_Service_Ebay_Finding

    63.21.1. Introduction

    Zend_Service_Ebay_Finding provides a client for the eBay Finding. Per eBay website, "The Finding API provides programmatic access to the next generation search capabilities on the eBay platform. It lets you search and browse for items listed on eBay, and provides useful metadata to refine searches and enhance the search experience."

    In order to use Zend_Service_Ebay_Finding, you should already have an eBay Application ID. To get a key and for more information, please visit the eBay Developers Program web site.

    63.21.2. Create a client object

    Instantiate a Zend_Service_Ebay_Finding object, passing it your private keys:

    Ejemplo 63.107. Creating an instance of the eBay Finding service

    $finding = new Zend_Service_Ebay_Finding('my-app-id');

    Instantiate a Zend_Service_Ebay_Finding object, passing it your private keys and setting options:

    Ejemplo 63.108. Creating an instance of the eBay Finding service

    $options = array(Zend_Service_Ebay_Abstract::OPTION_APP_ID    => 'my-app-id',
                     
    Zend_Service_Ebay_Abstract::OPTION_GLOBAL_ID => 'EBAY-GB');
    $finding = new Zend_Service_Ebay_Finding($options);

    63.21.3. Finding items

    There are five available methods to search items:

    • findItemsByKeywords($keywords)

    • findItemsByProduct($productId)

    • findItemsByCategory($categoryId)

    • findItemsAdvanced($keywords)

    • findItemsInEbayStores($storeName)

    Ejemplo 63.109. Many ways to find items

    $finding  = new Zend_Service_Ebay_Finding('my-app-id');
    $response $finding->findItemsByKeywords('zend framework book');
    foreach (
    $response->searchResult->item as $item) {
        
    $item->title;
        
    $item->listingInfo->buyItNowPrice;
        
    $item->listingInfo->viewItemURL;

        
    // inner call, find for items of same current product
        // like $finding->findItemsByProduct($item->productId, $item->attributes('productId', 'type'))
        
    $response2 $item->findItemsByProduct($finding);

        
    // inner call, find for items of same store
        // like $finding->findItemsInEbayStores($item->storeInfo->storeName)
        
    $response3 $item->storeInfo->findItems($finding);
    }

    63.21.4. Keywords Recommendation

    This operation checks specified keywords and returns correctly spelled keywords for best search results.

    Ejemplo 63.110. Searching keywords recomendation

    // searching keywords
    $finding = new Zend_Service_Ebay_Finding('my-app-id');
    $result  $finding->getSearchKeywordsRecommendation('zend');
    echo 
    'Did you mean ' $result->keyword '?';

    // inner call
    // like $finding->findItemsByKeywords($result->keyword)
    $result2 $result->findItems($finding);

    63.21.5. Histograms

    Per eBay website, this operation "category and/or aspect histogram information for the eBay category ID you specify. Histograms are item counts for the associated category or aspect value. Input category ID numbers in the request using the categoryId field".

    Ejemplo 63.111. Fetching histogram

    $finding = new Zend_Service_Ebay_Finding('my-app-id');
    $result  $finding->getHistograms($categoryId);

    foreach (
    $result->categoryHistogramContainer->categoryHistogram as $category) {
        
    $category->categoryId;
        
    $category->categoryName;

        
    // inner call
        // like $finding->findItemsByCategory($category->categoryId);
        
    $result2 $category->findItems($finding);
    }

    digg delicious meneame google twitter technorati facebook

    Comentarios

    Loading...