Prev | Current Page 174 | Next

David Berube

"Practical Reporting with Ruby and Rails"


end
If the method is passed a seller_id that isn??™t false or nil, you add a new parameter to
your call to GetSearchResults: IncludeSellers, which specifies which sellers to search for.
If a call to GetSearchResults has both an IncludeSellers and a Query parameter, it will
search for both; if the call has just an IncludeSellers value, it will return everything from
that seller. (If it has just a Query parameter, it will search for that keyword without regard
to who is selling the item.)
Next, since you??™ve created an array of parameters to be passed to the eBay web services
API, you need to begin constructing the actual URL you will send, as follows:
url_path = "/restapi?" << params.map{|param, value| "#{param}=#{value}"}.join("&")
response_body = Net::HTTP.get($ebay_config[:ebay_address], url_path)
The first line constructs the URL, turning the params hash into pairs of the form
name=value. These pairs are then joined by & symbols, and the resulting string is the path
you??™ll use to call the eBay REST API.


Pages:
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
Łona Maciej Maleńczuk wyniki na żywo Modern Talking sennik