Zend_Service_Ebay_Finding.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.ebay.finding">
  4. <title>Zend_Service_Ebay_Finding</title>
  5. <sect2 id="zend.service.ebay.finding.introduction">
  6. <title>Introduction</title>
  7. <para>
  8. <classname>Zend_Service_Ebay_Finding</classname> provides a client
  9. for the <ulink url="http://developer.ebay.com/DevZone/finding/CallRef/index.html">eBay Finding</ulink>.
  10. Per eBay website, "The Finding API provides programmatic access to
  11. the next generation search capabilities on the eBay platform. It
  12. lets you search and browse for items listed on eBay, and provides
  13. useful metadata to refine searches and enhance the search experience."
  14. </para>
  15. <para>
  16. In order to use <classname>Zend_Service_Ebay_Finding</classname>,
  17. you should already have an eBay Application ID. To get a key and for
  18. more information, please visit the
  19. <ulink url="https://developer.ebay.com/Join/default.aspx">eBay Developers Program</ulink>
  20. web site.
  21. </para>
  22. </sect2>
  23. <sect2 id="zend.service.ebay.finding.factoring">
  24. <title>Create a client object</title>
  25. <para>
  26. Instantiate a <classname>Zend_Service_Ebay_Finding</classname> object,
  27. passing it your private keys:
  28. </para>
  29. <example id="zend.service.ebay.finding.factoring.sample-1">
  30. <title>Creating an instance of the eBay Finding service</title>
  31. <programlisting language="php"><![CDATA[
  32. $finding = new Zend_Service_Ebay_Finding('my-app-id');
  33. ]]></programlisting>
  34. </example>
  35. <para>
  36. Instantiate a <classname>Zend_Service_Ebay_Finding</classname> object,
  37. passing it your private keys and setting options:
  38. </para>
  39. <example id="zend.service.ebay.finding.factoring.sample-2">
  40. <title>Creating an instance of the eBay Finding service</title>
  41. <programlisting language="php"><![CDATA[
  42. $options = array(Zend_Service_Ebay_Abstract::OPTION_APP_ID => 'my-app-id',
  43. Zend_Service_Ebay_Abstract::OPTION_GLOBAL_ID => 'EBAY-GB');
  44. $finding = new Zend_Service_Ebay_Finding($options);
  45. ]]></programlisting>
  46. </example>
  47. </sect2>
  48. <sect2 id="zend.service.ebay.finding.items">
  49. <title>Finding items</title>
  50. <para>
  51. There are five available methods to search items:
  52. <itemizedlist>
  53. <listitem>
  54. <para>findItemsByKeywords($keywords)</para>
  55. </listitem>
  56. <listitem>
  57. <para>findItemsByProduct($productId)</para>
  58. </listitem>
  59. <listitem>
  60. <para>findItemsByCategory($categoryId)</para>
  61. </listitem>
  62. <listitem>
  63. <para>findItemsAdvanced($keywords)</para>
  64. </listitem>
  65. <listitem>
  66. <para>findItemsInEbayStores($storeName)</para>
  67. </listitem>
  68. </itemizedlist>
  69. </para>
  70. <example id="zend.service.ebay.finding.items.sample">
  71. <title>Many ways to find items</title>
  72. <programlisting language="php"><![CDATA[
  73. $finding = new Zend_Service_Ebay_Finding('my-app-id');
  74. $response = $finding->findItemsByKeywords('zend framework book');
  75. foreach ($response->searchResult->item as $item) {
  76. $item->title;
  77. $item->listingInfo->buyItNowPrice;
  78. $item->listingInfo->viewItemURL;
  79. // inner call, find for items of same current product
  80. // like $finding->findItemsByProduct($item->productId, $item->attributes('productId', 'type'))
  81. $response2 = $item->findItemsByProduct($finding);
  82. // inner call, find for items of same store
  83. // like $finding->findItemsInEbayStores($item->storeInfo->storeName)
  84. $response3 = $item->storeInfo->findItems($finding);
  85. }
  86. ]]></programlisting>
  87. </example>
  88. </sect2>
  89. <sect2 id="zend.service.ebay.finding.keywords-recomendation">
  90. <title>Keywords Recommendation</title>
  91. <para>
  92. This operation checks specified keywords and returns correctly
  93. spelled keywords for best search results.
  94. </para>
  95. <example id="zend.service.ebay.finding.keywords.sample">
  96. <title>Searching keywords recomendation</title>
  97. <programlisting language="php"><![CDATA[
  98. // searching keywords
  99. $finding = new Zend_Service_Ebay_Finding('my-app-id');
  100. $result = $finding->getSearchKeywordsRecommendation('zend');
  101. echo 'Did you mean ' . $result->keyword . '?';
  102. // inner call
  103. // like $finding->findItemsByKeywords($result->keyword)
  104. $result2 = $result->findItems($finding);
  105. ]]></programlisting>
  106. </example>
  107. </sect2>
  108. <sect2 id="zend.service.ebay.finding.histogram">
  109. <title>Histograms</title>
  110. <para>
  111. Per eBay website, this operation "category and/or aspect histogram
  112. information for the eBay category ID you specify. Histograms are
  113. item counts for the associated category or aspect value. Input
  114. category ID numbers in the request using the categoryId field".
  115. </para>
  116. <example id="zend.service.ebay.finding.histogram.sample">
  117. <title>Fetching histogram</title>
  118. <programlisting language="php"><![CDATA[
  119. $finding = new Zend_Service_Ebay_Finding('my-app-id');
  120. $result = $finding->getHistograms($categoryId);
  121. foreach ($result->categoryHistogramContainer->categoryHistogram as $category) {
  122. $category->categoryId;
  123. $category->categoryName;
  124. // inner call
  125. // like $finding->findItemsByCategory($category->categoryId);
  126. $result2 = $category->findItems($finding);
  127. }
  128. ]]></programlisting>
  129. </example>
  130. </sect2>
  131. </sect1>
  132. <!--
  133. vim:se ts=4 sw=4 et:
  134. -->