rebay
rebay copied to clipboard
Pagination on find
I can see results info coming back from find_items_in_ebay_stores call but it doesn't handle pagination of the results. I can pass the pagination (page#) parameter but I get the same set (top 100 records) of data each time.
I need to be able to retrieve that other data (by pagenumber) and see the count info (totalPages and totalEntries)
in rebay / lib / rebay / finding.rb lines 57-58 you pull back only the 'items' array
It appears extra meta data is as follows (I see this after the 1st item record and before the next one (searchResult) )
Note: I changed data below where store to <
"@count"=>"10
0"}, @response={"itemSearchURL"=>"http://stores.ebay.com/<
Code I'm using to call as follows: response = finder.find_items_in_ebay_stores( {:storeName => '<<Storename>>', :pagination => {:entries_per_page => 100, :page_number => page_num} } )
created temp workaround. api.rb (line 30) needs its parms changed as passing wrong parms to ebay -- it needs to be in format &paginationInput.entriesPerPage=##&paginationInput.pageNumber=##
in finding.rb (before line 57) also return extra parm of pg = response.results['paginationOutput'] so can then pullout 'totalPages, 'totalEntries', 'pageNumber', 'entriesPerPage'
@thelal, I am sure you have gotten past this already, but I just wanted to show you (and others) an example of how I get pagination information.
Here is a simple example:
finding_response = Rebay::Finding.new.find_items_by_keywords(
:keywords => 'stuff',
:'paginationInput.entriesPerPage' => '100',
:'paginationInput.pageNumber' => '1',
)
# the results/items
finding_response.results
# the pagination information
finding_response.response["paginationOutput"] # => { 'entriesPerPage' => 100, 'pageNumber' => 1, 'totalEntries' => '1234', 'totalPages' => '13' }
Documentation for specifying Page and Per Page information to API: http://developer.ebay.com/DevZone/finding/CallRef/findItemsByKeywords.html#page
Documentation for paginationOutput: http://developer.ebay.com/DevZone/finding/CallRef/types/PaginationOutput.html