yahoo-api 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +165 -103
- data/lib/yahoo/api/version.rb +1 -1
- data/test.rb +0 -69
- data/yahoo-api.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f21fd68aca428a171edbce987c62440219abd5a0
|
4
|
+
data.tar.gz: 70fdb38c3c1d31fa0439e9aaebe47c7001ff57bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ff6b124bcd4593d4e776f18dcbc1f29c585d7c31fba82ab1a9f0d78a09364e4a9cbd1153d7cdd9a0fab1dd5c35a8b0e11ee2900d053e75fd98d0a75481767f2
|
7
|
+
data.tar.gz: 5b68c97b5fd6d57945b6afd8d37f75407299eca8eefe1b34862369565af0eae0e4f033ca70bb64202dd1fc0727770d97fff601883cd6402cdc2bcc8c78914e3e
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Yahoo::Api
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/yahoo-api.png)](http://badge.fury.io/rb/yahoo-api)
|
4
|
-
Ruby Yahoo Web API ( Shopping & Auction )
|
4
|
+
Ruby Yahoo Japan Web API ( Shopping & Auction )
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -21,114 +21,176 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
### Configure
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
```ruby
|
25
|
+
Yahoo::Api.configure do |options|
|
26
|
+
options[:appid] = 'your api id'
|
27
|
+
options[:affiliate_type] = "vc or yid"
|
28
|
+
options[:affiliate_id] = "your affiliate id"
|
29
|
+
end
|
30
|
+
```
|
29
31
|
|
30
32
|
### Yahoo Shopping API
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
Item Lookup API v1
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
res = Yahoo::Api::Shopping.review_search({:category_id => "13457"})
|
125
|
-
res["ResultSet"]["Result"].each do |v|
|
126
|
-
code = v["Target"]["Code"]
|
127
|
-
...
|
128
|
-
end
|
34
|
+
Refer to [Shopping Web API documentation](http://developer.yahoo.co.jp/webapi/shopping/) for more infomation.
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
# Item Search API v1
|
38
|
+
res = Yahoo::Api::Shopping.item_search({:category_id => "13457"})
|
39
|
+
res.code # 200
|
40
|
+
res.message # "OK"
|
41
|
+
|
42
|
+
res["ResultSet"]["totalResultsReturned"].times do |i|
|
43
|
+
code = res["ResultSet"]["0"]["Result"]["#{i}"]["Code"]
|
44
|
+
...
|
45
|
+
end
|
46
|
+
|
47
|
+
or
|
48
|
+
|
49
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
50
|
+
next unless i =~ /\d+/
|
51
|
+
code = v["Code"]
|
52
|
+
...
|
53
|
+
end
|
54
|
+
|
55
|
+
# Category Ranking API v1
|
56
|
+
res = Yahoo::Api::Shopping.category_ranking({:category_id => "13457"})
|
57
|
+
res["ResultSet"]["totalResultsReturned"].times do |i|
|
58
|
+
code = res["ResultSet"]["0"]["Result"]["#{i}"]["Code"]
|
59
|
+
...
|
60
|
+
end
|
61
|
+
|
62
|
+
# Category Search API v1
|
63
|
+
res = Yahoo::Api::Shopping.category_search({:category_id => "1"})
|
64
|
+
res["ResultSet"]["0"]["Result"]["Categories"]["Children"].each do |i,v|
|
65
|
+
next unless i =~ /\d+/
|
66
|
+
id = v["Id"]
|
67
|
+
...
|
68
|
+
end
|
69
|
+
|
70
|
+
# Item Lookup API v1
|
71
|
+
res = Yahoo::Api::Shopping.item_lookup({:itemcode => "hair_haclm352nn"})
|
72
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
73
|
+
next unless i =~ /\d+/
|
74
|
+
name = v["Name"]
|
75
|
+
...
|
76
|
+
end
|
77
|
+
|
78
|
+
# Query Ranking API v1
|
79
|
+
res = Yahoo::Api::Shopping.query_ranking({:category_id => "13457"})
|
80
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
81
|
+
next unless i =~ /\d+/
|
82
|
+
url = v["Url"]
|
83
|
+
...
|
84
|
+
end
|
85
|
+
|
86
|
+
# Content Match Item API v1
|
87
|
+
res = Yahoo::Api::Shopping.content_match_item({:url => "http://www.yahoo.co.jp/"})
|
88
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
89
|
+
next unless i =~ /\d+/
|
90
|
+
name = v["Name"]
|
91
|
+
...
|
92
|
+
end
|
93
|
+
|
94
|
+
# Content Match Ranking API v1
|
95
|
+
res = Yahoo::Api::Shopping.content_match_ranking({:url => "http://www.yahoo.co.jp/"})
|
96
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
97
|
+
next unless i =~ /\d+/
|
98
|
+
name = v["Name"]
|
99
|
+
...
|
100
|
+
end
|
101
|
+
|
102
|
+
# Get Module API v1
|
103
|
+
res = Yahoo::Api::Shopping.get_module({:category_id => "13457",:position => "eventrecommend"})
|
104
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
105
|
+
next unless i =~ /\d+/
|
106
|
+
title = v["Title"]
|
107
|
+
...
|
108
|
+
end
|
109
|
+
|
110
|
+
# Event Search API v1
|
111
|
+
res = Yahoo::Api::Shopping.event_search({:event_type => "store"})
|
112
|
+
res["ResultSet"]["0"]["Result"].each do |i,v|
|
113
|
+
next unless i =~ /\d+/
|
114
|
+
code = v["EventCode"]
|
115
|
+
...
|
116
|
+
end
|
117
|
+
|
118
|
+
# Review Search API v1
|
119
|
+
res = Yahoo::Api::Shopping.review_search({:category_id => "13457"})
|
120
|
+
res["ResultSet"]["Result"].each do |v|
|
121
|
+
code = v["Target"]["Code"]
|
122
|
+
...
|
123
|
+
end
|
124
|
+
```
|
129
125
|
|
130
126
|
### Yahoo Auction API
|
131
127
|
|
128
|
+
Refer to [Auction Web API documentation](http://developer.yahoo.co.jp/webapi/auctions/) for more infomation.
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
# Category Tree API v2
|
132
|
+
res = Yahoo::Api::Auction.category_tree({:category => "0"})
|
133
|
+
res.code # 200
|
134
|
+
res.message # "OK"
|
135
|
+
res["ResultSet"]["Result"]["ChildCategory"].each do |v|
|
136
|
+
id = v["CategoryId"]
|
137
|
+
...
|
138
|
+
end
|
139
|
+
|
140
|
+
# Category Leaf API v2
|
141
|
+
res = Yahoo::Api::Auction.category_leaf({:category => "23336"})
|
142
|
+
res["ResultSet"]["Result"]["Item"].each do |v|
|
143
|
+
id = v["AuctionID"]
|
144
|
+
...
|
145
|
+
end
|
146
|
+
|
147
|
+
# Selling List API v2
|
148
|
+
res = Yahoo::Api::Auction.selling_list({:sellerID => "ichienshop55"})
|
149
|
+
res["ResultSet"]["Result"]["Item"].each do |v|
|
150
|
+
id = v["AuctionID"]
|
151
|
+
...
|
152
|
+
end
|
153
|
+
|
154
|
+
# Search API v2
|
155
|
+
res = Yahoo::Api::Auction.item({:query => "au"})
|
156
|
+
res["ResultSet"]["Result"]["Item"].each do |v|
|
157
|
+
id = v["AuctionID"]
|
158
|
+
...
|
159
|
+
end
|
160
|
+
|
161
|
+
# Item API v2
|
162
|
+
res = Yahoo::Api::Auction.item({:auctionID => "x297261554"})
|
163
|
+
title = res["ResultSet"]["Result"]["Title"]
|
164
|
+
|
165
|
+
# Bid History API v1
|
166
|
+
res = Yahoo::Api::Auction.bid_history({:auctionID => "x297261554"})
|
167
|
+
res["ResultSet"]["Result"].each do |v|
|
168
|
+
id = v["Bidder"]
|
169
|
+
...
|
170
|
+
end
|
171
|
+
|
172
|
+
# Bid History Detail API v1
|
173
|
+
res = Yahoo::Api::Auction.bid_history_detail({:auctionID => "x297261554"})
|
174
|
+
res["ResultSet"]["Result"].each do |v|
|
175
|
+
id = v["Bidder"]
|
176
|
+
...
|
177
|
+
end
|
178
|
+
|
179
|
+
# Show Q & A API v1
|
180
|
+
res = Yahoo::Api::Auction.show_q_and_a({:auctionID => "h180241200"})
|
181
|
+
res["ResultSet"]["Result"]["QandA"].each do |v|
|
182
|
+
title = v["Title"]
|
183
|
+
...
|
184
|
+
end
|
185
|
+
|
186
|
+
# Show Rating API v1
|
187
|
+
res = Yahoo::Api::Auction.show_rating({:id => "kaz_vegi"})
|
188
|
+
res["ResultSet"]["Result"].each do |v|
|
189
|
+
title = v["Title"]
|
190
|
+
...
|
191
|
+
end
|
192
|
+
```
|
193
|
+
|
132
194
|
## Contributing
|
133
195
|
|
134
196
|
1. Fork it
|
data/lib/yahoo/api/version.rb
CHANGED
data/test.rb
CHANGED
@@ -1,69 +0,0 @@
|
|
1
|
-
require "yahoo/api"
|
2
|
-
Yahoo::Api.configure do |options|
|
3
|
-
options[:appid] = 'dj0zaiZpPVBzbEY1RWlSNVd2biZzPWNvbnN1bWVyc2VjcmV0Jng9MTU-'
|
4
|
-
end
|
5
|
-
|
6
|
-
# http://shopping.yahooapis.jp/ShoppingWebService/V1/json/reviewSearch?appid=dj0zaiZpPVBzbEY1RWlSNVd2biZzPWNvbnN1bWVyc2VjcmV0Jng9MTU-&category_id=13457
|
7
|
-
res = Yahoo::Api::Shopping.review_search({:category_id => "13457"})
|
8
|
-
# p res["ResultSet"]["Result"][]
|
9
|
-
res["ResultSet"]["Result"].each do |v|
|
10
|
-
# next unless i =~ /\d+/
|
11
|
-
p code = v["Target"]["Code"]
|
12
|
-
end
|
13
|
-
# res = Yahoo::Api::Shopping.event_search({:event_type => "store"})
|
14
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
15
|
-
# next unless i =~ /\d+/
|
16
|
-
# p code = v["EventCode"]
|
17
|
-
# end
|
18
|
-
# res = Yahoo::Api::Shopping.get_module({:category_id => "13457",:position => "eventrecommend"})
|
19
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
20
|
-
# next unless i =~ /\d+/
|
21
|
-
# p title = v["Title"]
|
22
|
-
# end
|
23
|
-
|
24
|
-
# res = Yahoo::Api::Shopping.content_match_ranking({:url => "http://www.yahoo.co.jp/"})
|
25
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
26
|
-
# next unless i =~ /\d+/
|
27
|
-
# p name = v["Name"]
|
28
|
-
# end
|
29
|
-
# res = Yahoo::Api::Shopping.content_match_item({:url => "http://www.yahoo.co.jp/"})
|
30
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
31
|
-
# next unless i =~ /\d+/
|
32
|
-
# p name = v["Name"]
|
33
|
-
# end
|
34
|
-
# res = Yahoo::Api::Shopping.query_ranking({:category_id => "13457"})
|
35
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
36
|
-
# next unless i =~ /\d+/
|
37
|
-
# p url = v["Url"]
|
38
|
-
# end
|
39
|
-
# res = Yahoo::Api::Shopping.item_lookup({:itemcode => "hair_haclm352nn"})
|
40
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
41
|
-
# next unless i =~ /\d+/
|
42
|
-
# p name = v["Name"]
|
43
|
-
# end
|
44
|
-
# res = Yahoo::Api::Shopping.category_search({:category_id => "1"})
|
45
|
-
# res["ResultSet"]["0"]["Result"]["Categories"]["Children"].each do |k,v|
|
46
|
-
# p id = v["Id"]
|
47
|
-
# next if id.nil?
|
48
|
-
# end
|
49
|
-
# # 0.times{|i| p i}
|
50
|
-
|
51
|
-
# res = Yahoo::Api::Shopping.category_ranking({:category_id => "13457"})
|
52
|
-
# res.code # 200
|
53
|
-
# res.message # "OK"
|
54
|
-
# res["ResultSet"]["0"]["Result"].each do |i,v|
|
55
|
-
# next unless i =~ /\d+/
|
56
|
-
# p v["Code"]
|
57
|
-
# end
|
58
|
-
# res["ResultSet"]["totalResultsReturned"].times do |i|
|
59
|
-
# p res["ResultSet"]["0"]["Result"]["#{i}"]["Code"]
|
60
|
-
# end
|
61
|
-
|
62
|
-
|
63
|
-
# res = Yahoo::Api::Shopping.item_search({:category_id => "13457"})
|
64
|
-
# p res.code # 200
|
65
|
-
# p res.message # "OK"
|
66
|
-
# res["ResultSet"]["totalResultsReturned"].times do |i|
|
67
|
-
# p res["ResultSet"]["0"]["Result"]["#{i}"]["Code"]
|
68
|
-
# end
|
69
|
-
|
data/yahoo-api.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Yahoo::Api::VERSION
|
9
9
|
spec.authors = ["shoprev"]
|
10
10
|
spec.email = ["admin@shoprev.net"]
|
11
|
-
spec.description = %q{Ruby Yahoo Web API ( Shopping & Auction )}
|
12
|
-
spec.summary = %q{Ruby Yahoo Web API ( Shopping & Auction )}
|
11
|
+
spec.description = %q{Ruby Yahoo Japan Web API ( Shopping & Auction )}
|
12
|
+
spec.summary = %q{Ruby Yahoo Japan Web API ( Shopping & Auction )}
|
13
13
|
spec.homepage = "https://github.com/shoprev/yahoo-api"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shoprev
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.11.0
|
83
|
-
description: Ruby Yahoo Web API ( Shopping & Auction )
|
83
|
+
description: Ruby Yahoo Japan Web API ( Shopping & Auction )
|
84
84
|
email:
|
85
85
|
- admin@shoprev.net
|
86
86
|
executables: []
|
@@ -130,7 +130,7 @@ rubyforge_project:
|
|
130
130
|
rubygems_version: 2.0.3
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
|
-
summary: Ruby Yahoo Web API ( Shopping & Auction )
|
133
|
+
summary: Ruby Yahoo Japan Web API ( Shopping & Auction )
|
134
134
|
test_files:
|
135
135
|
- spec/fixtures/shopping_content_match_item_http_/hoge_com/.yml
|
136
136
|
- spec/fixtures/shopping_content_match_item_http_/hogeaaaaaaaaaaaaaaaaaa_com/.yml
|