YahooAuctionApi ============== Version 0.0.1 - 2007/04/14 by Junya Ishihara == Overview This plugin is a library to use Yahoo Auction API on Ruby on Rails. == Installing Run script/plugin install http://rails-workshop-tokyo.googlecode.com/svn/trunk/plugins/yahoo_auction_api or checkout the source into your plugins folder. svn checkout http://rails-workshop-tokyo.googlecode.com/svn/trunk/plugins/yahoo_auction_api == Example Usage === Controller(yahoo_controller.rb) class YahooController < ApplicationController def auction auction_web_service = YahooAuctionApi::AuctionWebService.new( 'Your Yahoo Application ID' ) # For detail of parameters, please see # http://developer.yahoo.co.jp/auctions/rest/search/V1/search.html search_params = { :type => 'all', :page => 1, :aucminprice => nil, :aucmaxprice => nil, :aucmin_bidorbuy_price => nil, :aucmax_bidorbuy_price => nil, :aucmin_buynow_price => nil, :aucmax_buynow_price => nil, :loc_code => nil, :store => 0, :escrow => nil, :easypayment => nil, :new => nil, :largeimg => nil, :freeshipping => nil, :wrappingicon => nil, :buynow => nil, :thumbnail => 0, :attn => 0, :gift_icon => 0, :sort => 'end', :order => 'a' } # Get search results @results = auction_web_service.search('Search Keyword', search_params) end end === View(auction.rhtml)

Yahoo#auction

<%- unless @results.is_a?(Array) -%>

Error: <%= @results %>

<%- else -%> <%- @results.each do |result| -%>

<%= link_to result.title, result.url %> <%- result.option.each_value do |icon| -%> <%= icon.empty? ? '' : "" -%> <%- end -%>
Seller: <%= link_to result.seller.id, result.seller.rating %>

Price: <%= result.price %>
Bids: <%= result.bids %>
Endtime: <%= result.endtime %>
BidOrBuy: <%= result.bidorbuy %>
Reserved: <%= result.reserved %>

<%- end -%> <%- end -%> == Documentation You can create the documentation by running: rake rdoc == Required files open-uri rexml/document cgi == Links Yahoo! JAPAN DEVELOPER NETWORK http://developer.yahoo.co.jp/auctions/ == License This plugin is released under the MIT license. See MIT-LICENSE for details. == Feedback Please leave a comment or send a trackback to http://blog.champierre.com/archives/508