yahoo-api 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9faf607ee8fbce9ebfbd1c1eec571ee31f1fc8a3
4
- data.tar.gz: 0aa2aa2c5f1aa1cc7dfa5d1b690bed07d3362e05
3
+ metadata.gz: 910ca56b148beeda0e33d0b6ce4d6380a3f94f62
4
+ data.tar.gz: 10445b0edd0b2f6f797ce23037a2f1fa8f9b6432
5
5
  SHA512:
6
- metadata.gz: 0b8ec20438ab3bfcb1488ec27728eb23f5256cd5be758761baee2dceb4c6cfe3bb552392af8f85c47dc4568421f149741377099d2bfb44c4fe64b3c87011394a
7
- data.tar.gz: 9abafb342878c83b8ed7a794d6f87de578b9d2ad2c1feb4cef50d893eda9427956da91f0ba0c9dc01487ffecb3c87c27b2f1be685c3b91f8b9f5c5c2a270dabc
6
+ metadata.gz: 5a36ba286ac498a28e20da7e8d7db945e81719e230300b4f724ea0c18763f682f6f0077f7fb054917333b4d9447861901814b35a2eb3e2978620161083b0e348
7
+ data.tar.gz: f3dca075066b6d56dc2407b6fa3f7256eac6a167ac1422f2bd1eecc89ddbf70d89221a2c53a75e9f5aaa0f0a7201e7eb958d3d2ec03d3ef28a03077035eea685
data/lib/yahoo/api.rb CHANGED
@@ -25,6 +25,13 @@ module Yahoo
25
25
  yield @@options
26
26
  end
27
27
 
28
+ def merge(opts={})
29
+ opts.merge!(@@options)
30
+ ids = opts[:appid].split(",")
31
+ opts[:appid] = ids[rand(ids.size)]
32
+ opts
33
+ end
34
+
28
35
  def get(method,opts={})
29
36
  eval "#{method}(#{opts})"
30
37
  end
@@ -20,63 +20,63 @@ module Yahoo
20
20
  def category_tree(opts={})
21
21
  opts[:output] = 'json'
22
22
  opts[:callback] = 'callback'
23
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryTree", opts.merge(Yahoo::Api.options))
23
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryTree", Yahoo::Api.merge(opts))
24
24
  end
25
25
 
26
26
  # Yahoo Auction Category Leaf API v2
27
27
  def category_leaf(opts={})
28
28
  opts[:output] = 'json'
29
29
  opts[:callback] = 'callback'
30
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryLeaf", opts.merge(Yahoo::Api.options))
30
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryLeaf", Yahoo::Api.merge(opts))
31
31
  end
32
32
 
33
33
  # Yahoo Auction Selling List API v2
34
34
  def selling_list(opts={})
35
35
  opts[:output] = 'json'
36
36
  opts[:callback] = 'callback'
37
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/sellingList", opts.merge(Yahoo::Api.options))
37
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/sellingList", Yahoo::Api.merge(opts))
38
38
  end
39
39
 
40
40
  # Yahoo Auction Search API v2
41
41
  def search(opts={})
42
42
  opts[:output] = 'json'
43
43
  opts[:callback] = 'callback'
44
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/search", opts.merge(Yahoo::Api.options))
44
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/search", Yahoo::Api.merge(opts))
45
45
  end
46
46
 
47
47
  # Yahoo Auction Item API v2
48
48
  def item(opts={})
49
49
  opts[:output] = 'json'
50
50
  opts[:callback] = 'callback'
51
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem", opts.merge(Yahoo::Api.options))
51
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem", Yahoo::Api.merge(opts))
52
52
  end
53
53
 
54
54
  # Yahoo Auction Bid History API v1
55
55
  def bid_history(opts={})
56
56
  opts[:output] = 'json'
57
57
  opts[:callback] = 'callback'
58
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistory", opts.merge(Yahoo::Api.options))
58
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistory", Yahoo::Api.merge(opts))
59
59
  end
60
60
 
61
61
  # Yahoo Auction Bid History Detail API v1
62
62
  def bid_history_detail(opts={})
63
63
  opts[:output] = 'json'
64
64
  opts[:callback] = 'callback'
65
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistoryDetail", opts.merge(Yahoo::Api.options))
65
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistoryDetail", Yahoo::Api.merge(opts))
66
66
  end
67
67
 
68
68
  # Yahoo Auction Show Q & A API v1
69
69
  def show_q_and_a(opts={})
70
70
  opts[:output] = 'json'
71
71
  opts[:callback] = 'callback'
72
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/ShowQandA", opts.merge(Yahoo::Api.options))
72
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/ShowQandA", Yahoo::Api.merge(opts))
73
73
  end
74
74
 
75
75
  # Yahoo Auction Show Rating API v1
76
76
  def show_rating(opts={})
77
77
  opts[:output] = 'json'
78
78
  opts[:callback] = 'callback'
79
- Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/ShowRating", opts.merge(Yahoo::Api.options))
79
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/ShowRating", Yahoo::Api.merge(opts))
80
80
  end
81
81
 
82
82
  end
@@ -19,52 +19,52 @@ module Yahoo
19
19
 
20
20
  # Yahoo Shopping Item Search API v1
21
21
  def item_search(opts={})
22
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemSearch", opts.merge(Yahoo::Api.options))
22
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemSearch", Yahoo::Api.merge(opts))
23
23
  end
24
24
 
25
25
  # Yahoo Shopping Category Ranking API v1
26
26
  def category_ranking(opts={})
27
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categoryRanking", opts.merge(Yahoo::Api.options))
27
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categoryRanking", Yahoo::Api.merge(opts))
28
28
  end
29
29
 
30
30
  # Yahoo Shopping Category Search API v1
31
31
  def category_search(opts={})
32
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categorySearch", opts.merge(Yahoo::Api.options))
32
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categorySearch", Yahoo::Api.merge(opts))
33
33
  end
34
34
 
35
35
  # Yahoo Shopping Item Lookup API v1
36
36
  def item_lookup(opts={})
37
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemLookup", opts.merge(Yahoo::Api.options))
37
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemLookup", Yahoo::Api.merge(opts))
38
38
  end
39
39
 
40
40
  # Yahoo Shopping Query Ranking API v1
41
41
  def query_ranking(opts={})
42
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/queryRanking", opts.merge(Yahoo::Api.options))
42
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/queryRanking", Yahoo::Api.merge(opts))
43
43
  end
44
44
 
45
45
  # Yahoo Shopping Content Match Item API v1
46
46
  def content_match_item(opts={})
47
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem", opts.merge(Yahoo::Api.options))
47
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem", Yahoo::Api.merge(opts))
48
48
  end
49
49
 
50
50
  # Yahoo Shopping Content Match Ranking API v1
51
51
  def content_match_ranking(opts={})
52
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchRanking", opts.merge(Yahoo::Api.options))
52
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchRanking", Yahoo::Api.merge(opts))
53
53
  end
54
54
 
55
55
  # Yahoo Shopping Get Module API v1
56
56
  def get_module(opts={})
57
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/getModule", opts.merge(Yahoo::Api.options))
57
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/getModule", Yahoo::Api.merge(opts))
58
58
  end
59
59
 
60
60
  # Yahoo Shopping Event Search API v1
61
61
  def event_search(opts={})
62
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/eventSearch", opts.merge(Yahoo::Api.options))
62
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/eventSearch", Yahoo::Api.merge(opts))
63
63
  end
64
64
 
65
65
  # Yahoo Shopping Review Search API v1
66
66
  def review_search(opts={})
67
- Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/reviewSearch", opts.merge(Yahoo::Api.options))
67
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/reviewSearch", Yahoo::Api.merge(opts))
68
68
  end
69
69
 
70
70
  end
@@ -1,5 +1,5 @@
1
1
  module Yahoo
2
2
  class Api
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - shoprev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2013-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,7 +108,6 @@ files:
108
108
  - spec/spec_helper.rb
109
109
  - spec/yahoo/auction_spec.rb
110
110
  - spec/yahoo/shopping_spec.rb
111
- - test.rb
112
111
  - yahoo-api.gemspec
113
112
  homepage: https://github.com/shoprev/yahoo-api
114
113
  licenses: