yahoo-api 0.1.0 → 0.1.1

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: 91fbd1d3f46c53f413470f62689193ccbd401b08
4
- data.tar.gz: d762364a2c29d6d83f11a9aac5fd2e1bb236a46e
3
+ metadata.gz: 4fd3910f79d48d1ac0860545fc252aaea3342ffd
4
+ data.tar.gz: a79cb0bd89a4e3c57c09f80bf23d29fe2a42653f
5
5
  SHA512:
6
- metadata.gz: b4880ad68a865d85a9abcbfa079f60594fc01ec7a619a0bde94e40fb0c1ee960760119e529d2c1be494f2079f463adb69366ce35a4930945c13375db3c80d3ee
7
- data.tar.gz: c679ddd8c4c82de65075134a6159754290c7d93225ba6c02eb08e4dbafe3c24d1580ae57ab8b84f74b5837b2fe0816ca8dff73715eb6701aadc577d268c8c50c
6
+ metadata.gz: 07c2fb333b8f6f0984a91e49fef59f95667591f7fd118ca11dec1a54a6c930009d36c424d8a6c179bcd9e6ea792446e8a2d682c7e83cf088070c057477c20175
7
+ data.tar.gz: 98fc8dea5ee95a9bc289367636fc2203796fd2f375f07918b14e3e9a7012b726bceee3945c98550fc2c6fd56511d2c1a6f33a4aae81b028148406938761cda8c
data/.gitignore CHANGED
@@ -15,4 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
- spec/fixtures/*.yml
18
+ spec/fixtures/
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Yahoo::Api
2
2
 
3
- TODO: Write a gem description
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
5
 
5
6
  ## Installation
6
7
 
@@ -18,7 +19,61 @@ Or install it yourself as:
18
19
 
19
20
  ## Usage
20
21
 
21
- TODO: Write usage instructions here
22
+ ### Yahoo Shopping API
23
+
24
+ Yahoo Shopping Item Search API v1
25
+
26
+ res = Yahoo::Api::Shopping.item_search({:category_id => 13457})
27
+ res.code # 200
28
+ res.message # "OK"
29
+ res["ResultSet"]["totalResultsReturned"].times
30
+
31
+ Yahoo Shopping Category Ranking API v1
32
+ def category_ranking(opts={})
33
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categoryRanking", opts.merge(Yahoo::Api.options))
34
+ end
35
+
36
+ Yahoo Shopping Category Search API v1
37
+ def category_search(opts={})
38
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categorySearch", opts.merge(Yahoo::Api.options))
39
+ end
40
+
41
+ Yahoo Shopping Item Lookup API v1
42
+ def item_lookup(opts={})
43
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemLookup", opts.merge(Yahoo::Api.options))
44
+ end
45
+
46
+ Yahoo Shopping Query Ranking API v1
47
+ def query_ranking(opts={})
48
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/queryRanking", opts.merge(Yahoo::Api.options))
49
+ end
50
+
51
+ Yahoo Shopping Content Match Item API v1
52
+ def content_match_item(opts={})
53
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem", opts.merge(Yahoo::Api.options))
54
+ end
55
+
56
+ Yahoo Shopping Content Match Ranking API v1
57
+ def content_match_ranking(opts={})
58
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchRanking", opts.merge(Yahoo::Api.options))
59
+ end
60
+
61
+ Yahoo Shopping Get Module API v1
62
+ def get_module(opts={})
63
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/getModule", opts.merge(Yahoo::Api.options))
64
+ end
65
+
66
+ Yahoo Shopping Event Search API v1
67
+ def event_search(opts={})
68
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/eventSearch", opts.merge(Yahoo::Api.options))
69
+ end
70
+
71
+ Yahoo Shopping Review Search API v1
72
+ def review_search(opts={})
73
+ Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/reviewSearch", opts.merge(Yahoo::Api.options))
74
+ end
75
+
76
+ ### Yahoo Auction API
22
77
 
23
78
  ## Contributing
24
79
 
@@ -0,0 +1,78 @@
1
+ module Yahoo
2
+
3
+ class Api
4
+
5
+ class Auction
6
+
7
+ class << self
8
+
9
+ # Yahoo Auction Category Tree API v2
10
+ def category_tree(opts={})
11
+ opts[:output] = 'json'
12
+ opts[:callback] = 'callback'
13
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryTree", opts.merge(Yahoo::Api.options))
14
+ end
15
+
16
+ # Yahoo Auction Category Leaf API v2
17
+ def category_leaf(opts={})
18
+ opts[:output] = 'json'
19
+ opts[:callback] = 'callback'
20
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/categoryLeaf", opts.merge(Yahoo::Api.options))
21
+ end
22
+
23
+ # Yahoo Auction Selling List API v2
24
+ def selling_list(opts={})
25
+ opts[:output] = 'json'
26
+ opts[:callback] = 'callback'
27
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/sellingList", opts.merge(Yahoo::Api.options))
28
+ end
29
+
30
+ # Yahoo Auction Search API v2
31
+ def search(opts={})
32
+ opts[:output] = 'json'
33
+ opts[:callback] = 'callback'
34
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/search", opts.merge(Yahoo::Api.options))
35
+ end
36
+
37
+ # Yahoo Auction Item API v2
38
+ def item(opts={})
39
+ opts[:output] = 'json'
40
+ opts[:callback] = 'callback'
41
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem", opts.merge(Yahoo::Api.options))
42
+ end
43
+
44
+ # Yahoo Auction Bid History API v1
45
+ def bid_history(opts={})
46
+ opts[:output] = 'json'
47
+ opts[:callback] = 'callback'
48
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistory", opts.merge(Yahoo::Api.options))
49
+ end
50
+
51
+ # Yahoo Auction Bid History Detail API v1
52
+ def bid_history_detail(opts={})
53
+ opts[:output] = 'json'
54
+ opts[:callback] = 'callback'
55
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistoryDetail", opts.merge(Yahoo::Api.options))
56
+ end
57
+
58
+ # Yahoo Auction Show Q & A API v1
59
+ def show_q_and_a(opts={})
60
+ opts[:output] = 'json'
61
+ opts[:callback] = 'callback'
62
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/ShowQandA", opts.merge(Yahoo::Api.options))
63
+ end
64
+
65
+ # Yahoo Auction Show Rating API v1
66
+ def show_rating(opts={})
67
+ opts[:output] = 'json'
68
+ opts[:callback] = 'callback'
69
+ Yahoo::Request.get("http://auctions.yahooapis.jp/AuctionWebService/V1/ShowRating", opts.merge(Yahoo::Api.options))
70
+ end
71
+
72
+ end
73
+
74
+ end
75
+
76
+ end
77
+
78
+ end
@@ -0,0 +1,12 @@
1
+ module Yahoo
2
+
3
+ class Request
4
+
5
+ def self.get(path,opts)
6
+ uri = URI.parse("#{path}?#{opts.map {|k,v|"#{k}=#{URI.encode(v)}"}.join('&')}")
7
+ Yahoo::Response.new(Net::HTTP.get_response(uri))
8
+ end
9
+
10
+ end
11
+
12
+ end
@@ -0,0 +1,30 @@
1
+ module Yahoo
2
+
3
+ class Response
4
+
5
+ def initialize(response)
6
+ @response =response
7
+ body = @response.body
8
+ body = body[9..(body.rindex(")")-1)] if body.include?("callback(")
9
+ @body = JSON.parse(body)
10
+ end
11
+
12
+ def code
13
+ @response.code.to_i
14
+ end
15
+
16
+ def message
17
+ @response.message
18
+ end
19
+
20
+ def method_missing(name, *args, &block)
21
+ if @body.respond_to?(name)
22
+ @body.send(name, *args, &block)
23
+ else
24
+ super
25
+ end
26
+ end
27
+
28
+ end
29
+
30
+ end
@@ -0,0 +1,65 @@
1
+ module Yahoo
2
+
3
+ class Api
4
+
5
+ class Shopping
6
+
7
+ class << self
8
+
9
+ # Yahoo Shopping Item Search API v1
10
+ def item_search(opts={})
11
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemSearch", opts.merge(Yahoo::Api.options))
12
+ end
13
+
14
+ # Yahoo Shopping Category Ranking API v1
15
+ def category_ranking(opts={})
16
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categoryRanking", opts.merge(Yahoo::Api.options))
17
+ end
18
+
19
+ # Yahoo Shopping Category Search API v1
20
+ def category_search(opts={})
21
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/categorySearch", opts.merge(Yahoo::Api.options))
22
+ end
23
+
24
+ # Yahoo Shopping Item Lookup API v1
25
+ def item_lookup(opts={})
26
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/itemLookup", opts.merge(Yahoo::Api.options))
27
+ end
28
+
29
+ # Yahoo Shopping Query Ranking API v1
30
+ def query_ranking(opts={})
31
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/queryRanking", opts.merge(Yahoo::Api.options))
32
+ end
33
+
34
+ # Yahoo Shopping Content Match Item API v1
35
+ def content_match_item(opts={})
36
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem", opts.merge(Yahoo::Api.options))
37
+ end
38
+
39
+ # Yahoo Shopping Content Match Ranking API v1
40
+ def content_match_ranking(opts={})
41
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchRanking", opts.merge(Yahoo::Api.options))
42
+ end
43
+
44
+ # Yahoo Shopping Get Module API v1
45
+ def get_module(opts={})
46
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/getModule", opts.merge(Yahoo::Api.options))
47
+ end
48
+
49
+ # Yahoo Shopping Event Search API v1
50
+ def event_search(opts={})
51
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/eventSearch", opts.merge(Yahoo::Api.options))
52
+ end
53
+
54
+ # Yahoo Shopping Review Search API v1
55
+ def review_search(opts={})
56
+ Yahoo::Request.get("http://shopping.yahooapis.jp/ShoppingWebService/V1/json/reviewSearch", opts.merge(Yahoo::Api.options))
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+
63
+ end
64
+
65
+ end
@@ -1,5 +1,5 @@
1
1
  module Yahoo
2
2
  class Api
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem?affiliate_id=http%253A%252F%252Fck.jp.ap.valuecommerce.com%252Fservlet%252Freferral%253Fsid%253D2583199%2526pid%253D878377542%2526vc_url%253D&affiliate_type=vc&appid=dj0zaiZpPVBzbEY1RWlSNVd2biZzPWNvbnN1bWVyc2VjcmV0Jng9MTU-&url=http://hoge.com/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - shopping.yahooapis.jp
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 24 Sep 2013 06:45:12 GMT
25
+ Vary:
26
+ - Accept-Encoding
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Cache-Control:
30
+ - private
31
+ Connection:
32
+ - close
33
+ Transfer-Encoding:
34
+ - chunked
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ {"ResultSet":{"totalResultsAvailable":"68890784","totalResultsReturned":6,"firstResultPosition":"1","0":{"Result":{"Request":{"Url":"http:\/\/hoge.com\/"},"0":{"Name":"\u30d5\u30e9\u30f3\u30c6\u30f3\u30d7\u30b9 \u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u30ac\u30f4\u30a1\u30eb\u30cb","Headline":"\u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u4eba\u6c17 \u30e9\u30f3\u30ad\u30f3\u30b0 \u30bb\u30fc\u30eb","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fsincere-inc%2Fgavarnie.html","Image":{"Id":"sincere-inc_gavarnie","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/sincere-inc_gavarnie"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6825"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6825"},"_attributes":{"index":"1"}},"1":{"Name":"\u30c9\u30eb\u30de\u30f3\u30ef\u30f3\u30d4\u30fc\u30b9 \u30cb\u30c3\u30c8\u30bd\u30fc\u9001\u6599\u7121\u6599E1079","Headline":"\u30ef\u30f3\u30d4\u30fc\u30b9\u30c9\u30eb\u30de\u30f3\u30b9\u30ea\u30fc\u30d6","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fkobelettuce%2Fe1079.html","Image":{"Id":"kobelettuce_e1079","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/kobelettuce_e1079"},"Price":{"_attributes":{"currency":"JPY"},"_value":"1000"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"3900","SalePrice":"1000"},"_attributes":{"index":"2"}},"2":{"Name":"\u30c1\u30ce\u30d1\u30f3\u30c4 \u30c1\u30ce\/\u30b9\u30ad\u30cb\u30fc\/\u30e1\u30f3\u30ba\/\u30c1\u30ce\u30d1\u30f3\u30ab\u30fc\u30b4\/\u5c0f\u5c3b\u30fb\u811a\u9577\/\u30ab\u30e9\u30fc","Headline":"\u30c1\u30ce\u30d1\u30f3 \u30ab\u30fc\u30b4\/\u30e1\u30f3\u30ba \u30dc\u30c8\u30e0\u30b9\/\u30d1\u30f3\u30c4\/\u30b8\u30fc\u30f3\u30ba","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Facbt0010.html","Image":{"Id":"arcade_acbt0010","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_acbt0010"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"3"}},"3":{"Name":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5 \u30af\u30ed\u30ce\u30b0\u30e9\u30d5\u8155\u6642\u8a08 \u30e1\u30f3\u30ba\u3000\u30ec\u30c7\u30a3\u30fc\u30b9 \u8155\u6642\u8a08 COGU \u30b3\u30b0 HALD","Headline":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmanato%2Fcoglibdeitonad0.html","Image":{"Id":"manato_coglibdeitonad0","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/manato_coglibdeitonad0"},"Price":{"_attributes":{"currency":"JPY"},"_value":"16800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"58000","SalePrice":"16800"},"_attributes":{"index":"4"}},"4":{"Name":"\u672c\u9769\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8","Headline":"\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u672c\u9769","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmacaronijazz%2Fri015.html","Image":{"Id":"macaronijazz_ri015","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/macaronijazz_ri015"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6800"},"_attributes":{"index":"5"}},"5":{"Name":"\u9078\u3079\u308b\u9a5a\u757016\u30d1\u30bf\u30fc\u30f3\u3055\u3089\u306b\u8c4a\u5bcc\u306a\u30b5\u30a4\u30ba\/\u30b1\u30fc\u30d6\u30eb\u30cb\u30c3\u30c8\/\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3\/\u30b7\u30e7\u30fc\u30eb\u30ab\u30e9\u30fc\/\u30c9\u30f3\u30ad\u30fc\u887f","Headline":"\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Fpr10.html","Image":{"Id":"arcade_pr10","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_pr10"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"6"}},"_container":"Hit"}}}}
39
+ http_version:
40
+ recorded_at: Tue, 24 Sep 2013 06:45:14 GMT
41
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem?affiliate_id=http%253A%252F%252Fck.jp.ap.valuecommerce.com%252Fservlet%252Freferral%253Fsid%253D2583199%2526pid%253D878377542%2526vc_url%253D&affiliate_type=vc&appid=dj0zaiZpPVBzbEY1RWlSNVd2biZzPWNvbnN1bWVyc2VjcmV0Jng9MTU-&url=http://hogeaaaaaaaaaaaaaaaaaa.com/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - shopping.yahooapis.jp
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 24 Sep 2013 06:45:27 GMT
25
+ Vary:
26
+ - Accept-Encoding
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Cache-Control:
30
+ - private
31
+ Connection:
32
+ - close
33
+ Transfer-Encoding:
34
+ - chunked
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ {"ResultSet":{"totalResultsAvailable":"68890784","totalResultsReturned":6,"firstResultPosition":"1","0":{"Result":{"Request":{"Url":"http:\/\/hogeaaaaaaaaaaaaaaaaaa.com\/"},"0":{"Name":"\u30d5\u30e9\u30f3\u30c6\u30f3\u30d7\u30b9 \u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u30ac\u30f4\u30a1\u30eb\u30cb","Headline":"\u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u4eba\u6c17 \u30e9\u30f3\u30ad\u30f3\u30b0 \u30bb\u30fc\u30eb","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fsincere-inc%2Fgavarnie.html","Image":{"Id":"sincere-inc_gavarnie","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/sincere-inc_gavarnie"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6825"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6825"},"_attributes":{"index":"1"}},"1":{"Name":"\u30c9\u30eb\u30de\u30f3\u30ef\u30f3\u30d4\u30fc\u30b9 \u30cb\u30c3\u30c8\u30bd\u30fc\u9001\u6599\u7121\u6599E1079","Headline":"\u30ef\u30f3\u30d4\u30fc\u30b9\u30c9\u30eb\u30de\u30f3\u30b9\u30ea\u30fc\u30d6","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fkobelettuce%2Fe1079.html","Image":{"Id":"kobelettuce_e1079","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/kobelettuce_e1079"},"Price":{"_attributes":{"currency":"JPY"},"_value":"1000"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"3900","SalePrice":"1000"},"_attributes":{"index":"2"}},"2":{"Name":"\u30c1\u30ce\u30d1\u30f3\u30c4 \u30c1\u30ce\/\u30b9\u30ad\u30cb\u30fc\/\u30e1\u30f3\u30ba\/\u30c1\u30ce\u30d1\u30f3\u30ab\u30fc\u30b4\/\u5c0f\u5c3b\u30fb\u811a\u9577\/\u30ab\u30e9\u30fc","Headline":"\u30c1\u30ce\u30d1\u30f3 \u30ab\u30fc\u30b4\/\u30e1\u30f3\u30ba \u30dc\u30c8\u30e0\u30b9\/\u30d1\u30f3\u30c4\/\u30b8\u30fc\u30f3\u30ba","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Facbt0010.html","Image":{"Id":"arcade_acbt0010","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_acbt0010"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"3"}},"3":{"Name":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5 \u30af\u30ed\u30ce\u30b0\u30e9\u30d5\u8155\u6642\u8a08 \u30e1\u30f3\u30ba\u3000\u30ec\u30c7\u30a3\u30fc\u30b9 \u8155\u6642\u8a08 COGU \u30b3\u30b0 HALD","Headline":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmanato%2Fcoglibdeitonad0.html","Image":{"Id":"manato_coglibdeitonad0","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/manato_coglibdeitonad0"},"Price":{"_attributes":{"currency":"JPY"},"_value":"16800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"58000","SalePrice":"16800"},"_attributes":{"index":"4"}},"4":{"Name":"\u672c\u9769\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8","Headline":"\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u672c\u9769","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmacaronijazz%2Fri015.html","Image":{"Id":"macaronijazz_ri015","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/macaronijazz_ri015"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6800"},"_attributes":{"index":"5"}},"5":{"Name":"\u9078\u3079\u308b\u9a5a\u757016\u30d1\u30bf\u30fc\u30f3\u3055\u3089\u306b\u8c4a\u5bcc\u306a\u30b5\u30a4\u30ba\/\u30b1\u30fc\u30d6\u30eb\u30cb\u30c3\u30c8\/\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3\/\u30b7\u30e7\u30fc\u30eb\u30ab\u30e9\u30fc\/\u30c9\u30f3\u30ad\u30fc\u887f","Headline":"\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Fpr10.html","Image":{"Id":"arcade_pr10","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_pr10"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"6"}},"_container":"Hit"}}}}
39
+ http_version:
40
+ recorded_at: Tue, 24 Sep 2013 06:45:27 GMT
41
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem?affiliate_id=http%253A%252F%252Fck.jp.ap.valuecommerce.com%252Fservlet%252Freferral%253Fsid%253D2583199%2526pid%253D878377542%2526vc_url%253D&affiliate_type=vc&appid=dj0zaiZpPVBzbEY1RWlSNVd2biZzPWNvbnN1bWVyc2VjcmV0Jng9MTU-&url=http://www.yahoo.co.jp/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - shopping.yahooapis.jp
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 24 Sep 2013 06:43:50 GMT
25
+ Vary:
26
+ - Accept-Encoding
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Cache-Control:
30
+ - private
31
+ Connection:
32
+ - close
33
+ Transfer-Encoding:
34
+ - chunked
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ {"ResultSet":{"totalResultsAvailable":"68890784","totalResultsReturned":6,"firstResultPosition":"1","0":{"Result":{"Request":{"Url":"http:\/\/www.yahoo.co.jp\/"},"0":{"Name":"\u30d5\u30e9\u30f3\u30c6\u30f3\u30d7\u30b9 \u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u30ac\u30f4\u30a1\u30eb\u30cb","Headline":"\u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u4eba\u6c17 \u30e9\u30f3\u30ad\u30f3\u30b0 \u30bb\u30fc\u30eb","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fsincere-inc%2Fgavarnie.html","Image":{"Id":"sincere-inc_gavarnie","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/sincere-inc_gavarnie"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6825"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6825"},"_attributes":{"index":"1"}},"1":{"Name":"\u30c9\u30eb\u30de\u30f3\u30ef\u30f3\u30d4\u30fc\u30b9 \u30cb\u30c3\u30c8\u30bd\u30fc\u9001\u6599\u7121\u6599E1079","Headline":"\u30ef\u30f3\u30d4\u30fc\u30b9\u30c9\u30eb\u30de\u30f3\u30b9\u30ea\u30fc\u30d6","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fkobelettuce%2Fe1079.html","Image":{"Id":"kobelettuce_e1079","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/kobelettuce_e1079"},"Price":{"_attributes":{"currency":"JPY"},"_value":"1000"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"3900","SalePrice":"1000"},"_attributes":{"index":"2"}},"2":{"Name":"\u30c1\u30ce\u30d1\u30f3\u30c4 \u30c1\u30ce\/\u30b9\u30ad\u30cb\u30fc\/\u30e1\u30f3\u30ba\/\u30c1\u30ce\u30d1\u30f3\u30ab\u30fc\u30b4\/\u5c0f\u5c3b\u30fb\u811a\u9577\/\u30ab\u30e9\u30fc","Headline":"\u30c1\u30ce\u30d1\u30f3 \u30ab\u30fc\u30b4\/\u30e1\u30f3\u30ba \u30dc\u30c8\u30e0\u30b9\/\u30d1\u30f3\u30c4\/\u30b8\u30fc\u30f3\u30ba","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Facbt0010.html","Image":{"Id":"arcade_acbt0010","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_acbt0010"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"3"}},"3":{"Name":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5 \u30af\u30ed\u30ce\u30b0\u30e9\u30d5\u8155\u6642\u8a08 \u30e1\u30f3\u30ba\u3000\u30ec\u30c7\u30a3\u30fc\u30b9 \u8155\u6642\u8a08 COGU \u30b3\u30b0 HALD","Headline":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmanato%2Fcoglibdeitonad0.html","Image":{"Id":"manato_coglibdeitonad0","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/manato_coglibdeitonad0"},"Price":{"_attributes":{"currency":"JPY"},"_value":"16800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"58000","SalePrice":"16800"},"_attributes":{"index":"4"}},"4":{"Name":"\u672c\u9769\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8","Headline":"\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u672c\u9769","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmacaronijazz%2Fri015.html","Image":{"Id":"macaronijazz_ri015","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/macaronijazz_ri015"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6800"},"_attributes":{"index":"5"}},"5":{"Name":"\u9078\u3079\u308b\u9a5a\u757016\u30d1\u30bf\u30fc\u30f3\u3055\u3089\u306b\u8c4a\u5bcc\u306a\u30b5\u30a4\u30ba\/\u30b1\u30fc\u30d6\u30eb\u30cb\u30c3\u30c8\/\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3\/\u30b7\u30e7\u30fc\u30eb\u30ab\u30e9\u30fc\/\u30c9\u30f3\u30ad\u30fc\u887f","Headline":"\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Fpr10.html","Image":{"Id":"arcade_pr10","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_pr10"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"6"}},"_container":"Hit"}}}}
39
+ http_version:
40
+ recorded_at: Tue, 24 Sep 2013 06:43:50 GMT
41
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://shopping.yahooapis.jp/ShoppingWebService/V1/json/contentMatchItem?affiliate_id=http%253A%252F%252Fck.jp.ap.valuecommerce.com%252Fservlet%252Freferral%253Fsid%253D2583199%2526pid%253D878377542%2526vc_url%253D&affiliate_type=vc&appid=dj0zaiZpPVBzbEY1RWlSNVd2biZzPWNvbnN1bWVyc2VjcmV0Jng9MTU-&url=http://www.yahoo.co.jp/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - shopping.yahooapis.jp
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 24 Sep 2013 06:54:47 GMT
25
+ Vary:
26
+ - Accept-Encoding
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Cache-Control:
30
+ - private
31
+ Connection:
32
+ - close
33
+ Transfer-Encoding:
34
+ - chunked
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ {"ResultSet":{"totalResultsAvailable":"68890784","totalResultsReturned":6,"firstResultPosition":"1","0":{"Result":{"Request":{"Url":"http:\/\/www.yahoo.co.jp\/"},"0":{"Name":"\u30d5\u30e9\u30f3\u30c6\u30f3\u30d7\u30b9 \u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u30ac\u30f4\u30a1\u30eb\u30cb","Headline":"\u8155\u6642\u8a08 \u30e1\u30f3\u30ba \u4eba\u6c17 \u30e9\u30f3\u30ad\u30f3\u30b0 \u30bb\u30fc\u30eb","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fsincere-inc%2Fgavarnie.html","Image":{"Id":"sincere-inc_gavarnie","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/sincere-inc_gavarnie"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6825"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6825"},"_attributes":{"index":"1"}},"1":{"Name":"\u30c9\u30eb\u30de\u30f3\u30ef\u30f3\u30d4\u30fc\u30b9 \u30cb\u30c3\u30c8\u30bd\u30fc\u9001\u6599\u7121\u6599E1079","Headline":"\u30ef\u30f3\u30d4\u30fc\u30b9\u30c9\u30eb\u30de\u30f3\u30b9\u30ea\u30fc\u30d6","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fkobelettuce%2Fe1079.html","Image":{"Id":"kobelettuce_e1079","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/kobelettuce_e1079"},"Price":{"_attributes":{"currency":"JPY"},"_value":"1000"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"3900","SalePrice":"1000"},"_attributes":{"index":"2"}},"2":{"Name":"\u30c1\u30ce\u30d1\u30f3\u30c4 \u30c1\u30ce\/\u30b9\u30ad\u30cb\u30fc\/\u30e1\u30f3\u30ba\/\u30c1\u30ce\u30d1\u30f3\u30ab\u30fc\u30b4\/\u5c0f\u5c3b\u30fb\u811a\u9577\/\u30ab\u30e9\u30fc","Headline":"\u30c1\u30ce\u30d1\u30f3 \u30ab\u30fc\u30b4\/\u30e1\u30f3\u30ba \u30dc\u30c8\u30e0\u30b9\/\u30d1\u30f3\u30c4\/\u30b8\u30fc\u30f3\u30ba","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Facbt0010.html","Image":{"Id":"arcade_acbt0010","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_acbt0010"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"3"}},"3":{"Name":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5 \u30af\u30ed\u30ce\u30b0\u30e9\u30d5\u8155\u6642\u8a08 \u30e1\u30f3\u30ba\u3000\u30ec\u30c7\u30a3\u30fc\u30b9 \u8155\u6642\u8a08 COGU \u30b3\u30b0 HALD","Headline":"\u30af\u30ed\u30ce\u30b0\u30e9\u30d5","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmanato%2Fcoglibdeitonad0.html","Image":{"Id":"manato_coglibdeitonad0","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/manato_coglibdeitonad0"},"Price":{"_attributes":{"currency":"JPY"},"_value":"16800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"58000","SalePrice":"16800"},"_attributes":{"index":"4"}},"4":{"Name":"\u672c\u9769\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8","Headline":"\u30e9\u30a4\u30c0\u30fc\u30b9\u30b8\u30e3\u30b1\u30c3\u30c8\/\u30ec\u30b6\u30fc\u30b8\u30e3\u30b1\u30c3\u30c8\/\u672c\u9769","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Fmacaronijazz%2Fri015.html","Image":{"Id":"macaronijazz_ri015","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/macaronijazz_ri015"},"Price":{"_attributes":{"currency":"JPY"},"_value":"6800"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"6800"},"_attributes":{"index":"5"}},"5":{"Name":"\u9078\u3079\u308b\u9a5a\u757016\u30d1\u30bf\u30fc\u30f3\u3055\u3089\u306b\u8c4a\u5bcc\u306a\u30b5\u30a4\u30ba\/\u30b1\u30fc\u30d6\u30eb\u30cb\u30c3\u30c8\/\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3\/\u30b7\u30e7\u30fc\u30eb\u30ab\u30e9\u30fc\/\u30c9\u30f3\u30ad\u30fc\u887f","Headline":"\u30ab\u30fc\u30c7\u30a3\u30ac\u30f3","Url":"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2583199&pid=878377542&vc_url=http%3A%2F%2Fstore.shopping.yahoo.co.jp%2Farcade%2Fpr10.html","Image":{"Id":"arcade_pr10","Small":"http:\/\/item.shopping.c.yimg.jp\/i\/c\/arcade_pr10"},"Price":{"_attributes":{"currency":"JPY"},"_value":"2980"},"PriceLabel":{"_attributes":{"taxIncluded":"true"},"FixedPrice":"","SalePrice":"2980"},"_attributes":{"index":"6"}},"_container":"Hit"}}}}
39
+ http_version:
40
+ recorded_at: Tue, 24 Sep 2013 06:54:47 GMT
41
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,18 @@
1
+ # coding: utf-8
2
+ require 'webmock/rspec'
3
+ WebMock.disable_net_connect!
4
+ require 'vcr'
5
+
6
+ VCR.configure do |c|
7
+ c.cassette_library_dir = File.expand_path(File.dirname(__FILE__) + '/fixtures')
8
+ c.hook_into :webmock
9
+ c.allow_http_connections_when_no_cassette = true
10
+ end
11
+
12
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/yahoo/api')
13
+
14
+ Yahoo::Api.configure do |options|
15
+ options[:appid] = 'your api id'
16
+ options[:affiliate_type] = "vc or yid"
17
+ options[:affiliate_id] = "your affiliate id"
18
+ end
@@ -0,0 +1,184 @@
1
+ # coding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
3
+
4
+ share_examples_for 'found items' do
5
+ context 'code' do
6
+ it { expect(res.code).to eq 200 }
7
+ end
8
+ context 'size' do
9
+ it { expect(res["ResultSet"]["@attributes"]["totalResultsReturned"].to_i).to be > 0 }
10
+ end
11
+ end
12
+
13
+ share_examples_for 'not found items' do
14
+ context 'code' do
15
+ it { expect(res.code).to eq 200 }
16
+ end
17
+ context 'size' do
18
+ it { expect(res["ResultSet"]["@attributes"]["totalResultsReturned"].to_i).to eq 0 }
19
+ end
20
+ end
21
+
22
+ share_examples_for 'bad request' do
23
+ context 'code' do
24
+ it { expect(res_error.code).to eq 400 }
25
+ end
26
+ context 'message' do
27
+ it { expect(res_error.message).to eq 'Bad Request' }
28
+ end
29
+ end
30
+
31
+ describe "Yahoo::Api::Auction.show_rating" do
32
+
33
+ let(:res) {
34
+ VCR.use_cassette('auction_show_rating_' + id.to_s) do
35
+ Yahoo::Api::Auction.show_rating({:id => id})
36
+ end
37
+ }
38
+
39
+ let(:res_error) {
40
+ VCR.use_cassette('auction_show_rating') do
41
+ Yahoo::Api::Auction.show_rating({})
42
+ end
43
+ }
44
+
45
+ context 'found items' do
46
+ let(:id) { 'kaz_vegi' }
47
+ it_should_behave_like 'found items'
48
+ end
49
+
50
+ context 'bad request' do
51
+ it_should_behave_like 'bad request'
52
+ end
53
+
54
+ end
55
+
56
+ describe "Yahoo::Api::Auction.show_q_and_a" do
57
+
58
+ let(:res) {
59
+ VCR.use_cassette('auction_show_q_and_a_' + auctionID.to_s) do
60
+ Yahoo::Api::Auction.show_q_and_a({:auctionID => auctionID})
61
+ end
62
+ }
63
+
64
+ context 'found items' do
65
+ let(:auctionID) { 'h180241200' }
66
+ it_should_behave_like 'found items'
67
+ end
68
+
69
+ context 'not found items' do
70
+ let(:auctionID) { 'x297261554' }
71
+ it_should_behave_like 'not found items'
72
+ end
73
+
74
+ end
75
+
76
+ describe "Yahoo::Api::Auction.bid_history_detail" do
77
+
78
+ let(:res) {
79
+ VCR.use_cassette('auction_bid_history_detail_' + auctionID.to_s) do
80
+ Yahoo::Api::Auction.bid_history_detail({:auctionID => auctionID})
81
+ end
82
+ }
83
+
84
+ context 'found items' do
85
+ let(:auctionID) { 'x297261554' }
86
+ it_should_behave_like 'found items'
87
+ end
88
+
89
+ end
90
+
91
+ describe "Yahoo::Api::Auction.bid_history" do
92
+
93
+ let(:res) {
94
+ VCR.use_cassette('auction_bid_history_' + auctionID.to_s) do
95
+ Yahoo::Api::Auction.bid_history({:auctionID => auctionID})
96
+ end
97
+ }
98
+
99
+ context 'found items' do
100
+ let(:auctionID) { 'x297261554' }
101
+ it_should_behave_like 'found items'
102
+ end
103
+
104
+ end
105
+
106
+ describe "Yahoo::Api::Auction.item" do
107
+
108
+ let(:res) {
109
+ VCR.use_cassette('auction_item_' + auctionID.to_s) do
110
+ Yahoo::Api::Auction.item({:auctionID => auctionID})
111
+ end
112
+ }
113
+
114
+ context 'found items' do
115
+ let(:auctionID) { 'x297261554' }
116
+ it_should_behave_like 'found items'
117
+ end
118
+
119
+ end
120
+
121
+ describe "Yahoo::Api::Auction.search" do
122
+
123
+ let(:res) {
124
+ VCR.use_cassette('auction_search_' + query.to_s) do
125
+ Yahoo::Api::Auction.search({:query => query})
126
+ end
127
+ }
128
+
129
+ context 'found items' do
130
+ let(:query) { 'au' }
131
+ it_should_behave_like 'found items'
132
+ end
133
+
134
+ context 'not found items' do
135
+ let(:query) { 'auaaaaaaaaaaaaaaa' }
136
+ it_should_behave_like 'not found items'
137
+ end
138
+
139
+ end
140
+
141
+ describe "Yahoo::Api::Auction.selling_list" do
142
+
143
+ let(:res) {
144
+ VCR.use_cassette('auction_selling_list_' + sellerID.to_s) do
145
+ Yahoo::Api::Auction.selling_list({:sellerID => sellerID})
146
+ end
147
+ }
148
+
149
+ context 'found items' do
150
+ let(:sellerID) { 'ichienshop55' }
151
+ it_should_behave_like 'found items'
152
+ end
153
+
154
+ end
155
+
156
+ describe "Yahoo::Api::Auction.category_leaf" do
157
+
158
+ let(:res) {
159
+ VCR.use_cassette('auction_category_leaf_' + category.to_s) do
160
+ Yahoo::Api::Auction.category_leaf({:category => category})
161
+ end
162
+ }
163
+
164
+ context 'found items' do
165
+ let(:category) { '23336' }
166
+ it_should_behave_like 'found items'
167
+ end
168
+
169
+ end
170
+
171
+ describe "Yahoo::Api::Auction.category_tree" do
172
+
173
+ let(:res) {
174
+ VCR.use_cassette('auction_category_tree_' + category.to_s) do
175
+ Yahoo::Api::Auction.category_tree({:category => category})
176
+ end
177
+ }
178
+
179
+ context 'found items' do
180
+ let(:category) { '0' }
181
+ it_should_behave_like 'found items'
182
+ end
183
+
184
+ end
@@ -0,0 +1,334 @@
1
+ # coding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
3
+
4
+ share_examples_for 'found items' do
5
+ context 'code' do
6
+ it { expect(res_genre.code).to eq 200 }
7
+ end
8
+ context 'size' do
9
+ it { expect(res_genre["ResultSet"]["totalResultsReturned"].to_i).to be > 0 }
10
+ end
11
+ end
12
+
13
+ share_examples_for 'not found items' do
14
+ context 'code' do
15
+ it { expect(res_genre.code).to eq 200 }
16
+ end
17
+ context 'size' do
18
+ it { expect(res_genre["ResultSet"]["totalResultsReturned"].to_i).to eq 0 }
19
+ end
20
+ end
21
+
22
+ share_examples_for 'found items by genre' do
23
+ context 'code' do
24
+ it { expect(res_genre.code).to eq 200 }
25
+ end
26
+ context 'size' do
27
+ it { expect(res_genre["ResultSet"]["totalResultsReturned"].to_i).to be > 0 }
28
+ end
29
+ end
30
+
31
+ share_examples_for 'not found items by genre' do
32
+ context 'code' do
33
+ it { expect(res_genre.code).to eq 200 }
34
+ end
35
+ context 'size' do
36
+ it { expect(res_genre["ResultSet"]["totalResultsReturned"].to_i).to eq 0 }
37
+ end
38
+ end
39
+
40
+ share_examples_for 'found items by keyword' do
41
+ context 'code' do
42
+ it { expect(res_keyword.code).to eq 200 }
43
+ end
44
+ context 'size' do
45
+ it { expect(res_keyword["ResultSet"]["totalResultsReturned"].to_i).to be > 0 }
46
+ end
47
+ end
48
+
49
+ share_examples_for 'not found items by keyword' do
50
+ context 'code' do
51
+ it { expect(res_keyword.code).to eq 200 }
52
+ end
53
+ context 'size' do
54
+ it { expect(res_keyword["ResultSet"]["totalResultsReturned"].to_i).to eq 0 }
55
+ end
56
+ end
57
+
58
+
59
+ share_examples_for 'bad request' do
60
+ context 'code' do
61
+ it { expect(res_error.code).to eq 400 }
62
+ end
63
+ context 'message' do
64
+ it { expect(res_error.message).to eq 'Bad Request' }
65
+ end
66
+ end
67
+
68
+ describe "Yahoo::Api::Shopping.review_search" do
69
+
70
+ let(:res_genre) {
71
+ VCR.use_cassette('shopping_review_search_' + category_id.to_s) do
72
+ Yahoo::Api::Shopping.review_search({:category_id => category_id})
73
+ end
74
+ }
75
+
76
+ let(:res_error) {
77
+ VCR.use_cassette('shopping_review_search') do
78
+ Yahoo::Api::Shopping.review_search({})
79
+ end
80
+ }
81
+
82
+ context 'found items by genre' do
83
+ let(:category_id) { '13457' }
84
+ it_should_behave_like 'found items by genre'
85
+ end
86
+
87
+ context 'bad request' do
88
+ it_should_behave_like 'bad request'
89
+ end
90
+
91
+ end
92
+
93
+ describe "Yahoo::Api::Shopping.event_search" do
94
+
95
+ let(:res_genre) {
96
+ VCR.use_cassette('shopping_event_search_' + event_type.to_s) do
97
+ Yahoo::Api::Shopping.event_search({:event_type => event_type})
98
+ end
99
+ }
100
+
101
+ let(:res_error) {
102
+ VCR.use_cassette('shopping_event_search') do
103
+ Yahoo::Api::Shopping.event_search({})
104
+ end
105
+ }
106
+
107
+ context 'found items' do
108
+ let(:event_type) { 'store' }
109
+ it_should_behave_like 'found items'
110
+ end
111
+
112
+ end
113
+
114
+ describe "Yahoo::Api::Shopping.get_module" do
115
+
116
+ let(:res_genre) {
117
+ VCR.use_cassette('shopping_get_module_' + category_id.to_s+ '_'+ position.to_s) do
118
+ Yahoo::Api::Shopping.get_module({:category_id => category_id,:position => position})
119
+ end
120
+ }
121
+
122
+ let(:res_error) {
123
+ VCR.use_cassette('shopping_get_module') do
124
+ Yahoo::Api::Shopping.get_module({})
125
+ end
126
+ }
127
+
128
+ context 'found items by genre' do
129
+ let(:category_id) { '13457' }
130
+ let(:position) { 'eventrecommend' }
131
+ it_should_behave_like 'found items by genre'
132
+ end
133
+
134
+ context 'bad request' do
135
+ it_should_behave_like 'bad request'
136
+ end
137
+
138
+ end
139
+
140
+ describe "Yahoo::Api::Shopping.content_match_ranking" do
141
+
142
+ let(:res_genre) {
143
+ VCR.use_cassette('shopping_content_match_ranking' + url.to_s) do
144
+ Yahoo::Api::Shopping.content_match_item({:url => url})
145
+ end
146
+ }
147
+
148
+ let(:res_error) {
149
+ VCR.use_cassette('shopping_content_match_ranking') do
150
+ Yahoo::Api::Shopping.content_match_item({})
151
+ end
152
+ }
153
+
154
+ context 'found items' do
155
+ let(:url) { URI.encode('http://www.yahoo.co.jp/') }
156
+ it_should_behave_like 'found items'
157
+ end
158
+
159
+ context 'bad request' do
160
+ it_should_behave_like 'bad request'
161
+ end
162
+
163
+ end
164
+
165
+ describe "Yahoo::Api::Shopping.content_match_item" do
166
+
167
+ let(:res_genre) {
168
+ VCR.use_cassette('shopping_content_match_item_' + url.to_s) do
169
+ Yahoo::Api::Shopping.content_match_item({:url => url})
170
+ end
171
+ }
172
+
173
+ let(:res_error) {
174
+ VCR.use_cassette('shopping_content_match_item') do
175
+ Yahoo::Api::Shopping.content_match_item({})
176
+ end
177
+ }
178
+
179
+ context 'found items' do
180
+ let(:url) { URI.encode('http://www.yahoo.co.jp/') }
181
+ it_should_behave_like 'found items'
182
+ end
183
+
184
+ context 'bad request' do
185
+ it_should_behave_like 'bad request'
186
+ end
187
+
188
+ end
189
+
190
+ describe "Yahoo::Api::Shopping.query_ranking" do
191
+
192
+ let(:res_genre) {
193
+ VCR.use_cassette('shopping_query_ranking_' + category_id.to_s) do
194
+ Yahoo::Api::Shopping.query_ranking({:category_id => category_id})
195
+ end
196
+ }
197
+
198
+ context 'found items by genre' do
199
+ let(:category_id) { '13457' }
200
+ it_should_behave_like 'found items by genre'
201
+ end
202
+
203
+ context 'not found items by genre' do
204
+ let(:category_id) { '399811111' }
205
+ it_should_behave_like 'not found items by genre'
206
+ end
207
+
208
+ end
209
+
210
+ describe "Yahoo::Api::Shopping.item_lookup" do
211
+
212
+ let(:res_genre) {
213
+ VCR.use_cassette('shopping_item_lookup_' + itemcode.to_s) do
214
+ Yahoo::Api::Shopping.item_lookup({:itemcode => itemcode})
215
+ end
216
+ }
217
+
218
+ let(:res_error) {
219
+ VCR.use_cassette('shopping_item_lookup') do
220
+ Yahoo::Api::Shopping.item_lookup({})
221
+ end
222
+ }
223
+
224
+ context 'found items by genre' do
225
+ let(:itemcode) { 'hair_haclm352nn' }
226
+ it_should_behave_like 'found items by genre'
227
+ end
228
+
229
+ context 'not found items by genre' do
230
+ let(:itemcode) { 'eshopping_113cd02221164' }
231
+ it_should_behave_like 'not found items by genre'
232
+ end
233
+
234
+ context 'bad request' do
235
+ it_should_behave_like 'bad request'
236
+ end
237
+
238
+ end
239
+
240
+ describe "Yahoo::Api::Shopping.category_search" do
241
+
242
+ let(:res_genre) {
243
+ VCR.use_cassette('shopping_category_search_' + category_id.to_s) do
244
+ Yahoo::Api::Shopping.category_search({:category_id => category_id})
245
+ end
246
+ }
247
+
248
+ let(:res_error) {
249
+ VCR.use_cassette('shopping_category_search') do
250
+ Yahoo::Api::Shopping.category_search({})
251
+ end
252
+ }
253
+
254
+ context 'found items by genre' do
255
+ let(:category_id) { '1' }
256
+ it_should_behave_like 'found items by genre'
257
+ end
258
+
259
+ context 'bad request' do
260
+ it_should_behave_like 'bad request'
261
+ end
262
+
263
+ end
264
+
265
+ describe "Yahoo::Api::Shopping.category_ranking" do
266
+
267
+ let(:res_genre) {
268
+ VCR.use_cassette('shopping_category_ranking_' + category_id.to_s+ '_'+ gender.to_s) do
269
+ Yahoo::Api::Shopping.category_ranking({:category_id => category_id,:gender => gender})
270
+ end
271
+ }
272
+
273
+ context 'found items by genre' do
274
+ let(:category_id) { '13457' }
275
+ let(:gender) { 'female' }
276
+ it_should_behave_like 'found items by genre'
277
+ end
278
+
279
+ context 'not found items by genre' do
280
+ let(:category_id) { '95' }
281
+ let(:gender) { 'female' }
282
+ it_should_behave_like 'not found items by genre'
283
+ end
284
+
285
+ end
286
+
287
+ describe "Yahoo::Api::Shopping.item_search" do
288
+
289
+ let(:res_genre) {
290
+ VCR.use_cassette('shopping_item_search_' + category_id.to_s+ '_'+ exp_area.to_s) do
291
+ Yahoo::Api::Shopping.item_search({:category_id => category_id,:exp_area => exp_area})
292
+ end
293
+ }
294
+
295
+ let(:res_keyword) {
296
+ VCR.use_cassette('shopping_item_search_' + query.to_s) do
297
+ Yahoo::Api::Shopping.item_search({:query => query})
298
+ end
299
+ }
300
+
301
+ let(:res_error) {
302
+ VCR.use_cassette('shopping_item_search') do
303
+ Yahoo::Api::Shopping.item_search({})
304
+ end
305
+ }
306
+
307
+ context 'found items by genre' do
308
+ let(:category_id) { '13457' }
309
+ let(:exp_area) { '13' }
310
+ it_should_behave_like 'found items by genre'
311
+ end
312
+
313
+ context 'not found items by genre' do
314
+ let(:category_id) { '617' }
315
+ let(:exp_area) { '01' }
316
+ it_should_behave_like 'not found items by genre'
317
+ end
318
+
319
+ context 'found items by keyword' do
320
+ let(:query) { 'au' }
321
+ it_should_behave_like 'found items by keyword'
322
+ end
323
+
324
+ context 'not found items by keyword' do
325
+ let(:query) { 'auaaaaaaa' }
326
+ it_should_behave_like 'not found items by keyword'
327
+ end
328
+
329
+ context 'bad request' do
330
+ it_should_behave_like 'bad request'
331
+ end
332
+
333
+ end
334
+
data/test.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "yahoo/api"
2
+ res = Yahoo::Api::Shopping.item_search({:category_id => 13457})
3
+ p res.code # 200
4
+ p res.message # "OK"
5
+ #res["ResultSet"]["totalResultsReturned"].times
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - shoprev
@@ -93,7 +93,19 @@ files:
93
93
  - README.md
94
94
  - Rakefile
95
95
  - lib/yahoo/api.rb
96
+ - lib/yahoo/api/auction.rb
97
+ - lib/yahoo/api/request.rb
98
+ - lib/yahoo/api/response.rb
99
+ - lib/yahoo/api/shopping.rb
96
100
  - lib/yahoo/api/version.rb
101
+ - spec/fixtures/shopping_content_match_item_http_/hoge_com/.yml
102
+ - spec/fixtures/shopping_content_match_item_http_/hogeaaaaaaaaaaaaaaaaaa_com/.yml
103
+ - spec/fixtures/shopping_content_match_item_http_/www_yahoo_co_jp/.yml
104
+ - spec/fixtures/shopping_content_match_rankinghttp_/www_yahoo_co_jp/.yml
105
+ - spec/spec_helper.rb
106
+ - spec/yahoo/auction_spec.rb
107
+ - spec/yahoo/shopping_spec.rb
108
+ - test.rb
97
109
  - yahoo-api.gemspec
98
110
  homepage: https://github.com/shoprev/yahoo-api
99
111
  licenses:
@@ -119,4 +131,11 @@ rubygems_version: 2.0.3
119
131
  signing_key:
120
132
  specification_version: 4
121
133
  summary: Ruby Yahoo Web API ( Shopping & Auction )
122
- test_files: []
134
+ test_files:
135
+ - spec/fixtures/shopping_content_match_item_http_/hoge_com/.yml
136
+ - spec/fixtures/shopping_content_match_item_http_/hogeaaaaaaaaaaaaaaaaaa_com/.yml
137
+ - spec/fixtures/shopping_content_match_item_http_/www_yahoo_co_jp/.yml
138
+ - spec/fixtures/shopping_content_match_rankinghttp_/www_yahoo_co_jp/.yml
139
+ - spec/spec_helper.rb
140
+ - spec/yahoo/auction_spec.rb
141
+ - spec/yahoo/shopping_spec.rb