untappd 0.0.5 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +23 -15
  4. data/README.md +137 -0
  5. data/Rakefile +7 -2
  6. data/examples/aba_checkins.rb +5 -41
  7. data/examples/checkin.rb +10 -11
  8. data/examples/user_feed.rb +5 -4
  9. data/lib/untappd.rb +4 -23
  10. data/lib/untappd/base.rb +11 -9
  11. data/lib/untappd/beer.rb +20 -44
  12. data/lib/untappd/brewery.rb +13 -31
  13. data/lib/untappd/checkin.rb +53 -93
  14. data/lib/untappd/config.rb +28 -0
  15. data/lib/untappd/oauth.rb +9 -0
  16. data/lib/untappd/user.rb +38 -59
  17. data/lib/untappd/venue.rb +9 -21
  18. data/lib/untappd/version.rb +1 -1
  19. data/spec/beer_spec.rb +19 -64
  20. data/spec/brewery_spec.rb +12 -49
  21. data/spec/checkin_spec.rb +29 -75
  22. data/spec/config_spec.rb +17 -0
  23. data/spec/oauth_spec.rb +17 -0
  24. data/spec/spec_helper.rb +24 -0
  25. data/spec/user_spec.rb +26 -108
  26. data/spec/vcr/Beer/get_feed.yml +239 -0
  27. data/spec/vcr/Beer/get_info.yml +186 -0
  28. data/spec/vcr/Beer/get_search.yml +324 -0
  29. data/spec/vcr/Beer/get_trending_beers.yml +108 -0
  30. data/spec/vcr/Brewery/get_feed.yml +219 -0
  31. data/spec/vcr/Brewery/get_info.yml +372 -0
  32. data/spec/vcr/Brewery/get_search.yml +51 -0
  33. data/spec/vcr/Checkin/get/gets_info.yml +49 -0
  34. data/spec/vcr/Checkin/get/gets_thepub_feed.yml +240 -0
  35. data/spec/vcr/Checkin/post/add_comment.yml +47 -0
  36. data/spec/vcr/Checkin/post/adds_toast.yml +45 -0
  37. data/spec/vcr/Checkin/post/creates_checkin.yml +53 -0
  38. data/spec/vcr/Checkin/post/removes_comment.yml +46 -0
  39. data/spec/vcr/Checkin/post/removes_toast.yml +44 -0
  40. data/spec/vcr/User/get_badges.yml +45 -0
  41. data/spec/vcr/User/get_distinct_beers.yml +82 -0
  42. data/spec/vcr/User/get_feed.yml +78 -0
  43. data/spec/vcr/User/get_friend_feed.yml +460 -0
  44. data/spec/vcr/User/get_friends.yml +43 -0
  45. data/spec/vcr/User/get_info.yml +109 -0
  46. data/spec/vcr/User/get_wish_list.yml +47 -0
  47. data/spec/vcr/Venue/gets_info.yml +67 -0
  48. data/spec/vcr/Venue/gets_the_feed.yml +65 -0
  49. data/spec/venue_spec.rb +8 -36
  50. data/untappd.gemspec +3 -1
  51. metadata +146 -78
  52. data/README.rdoc +0 -107
  53. data/spec/untappd_spec.rb +0 -13
@@ -1,41 +1,23 @@
1
1
  module Untappd
2
-
3
2
  class Brewery < Base
4
-
5
- # since (optional) - The numeric ID of the last recent check-in.
6
- # offset (optional) - The offset that you like the dataset to begin with.
7
- # Each set returns 25 max records, so you can use that paginate the feed.
3
+ # options:
4
+ # * min_id (int, optional) - The numeric ID of the most recent check-in. New results
5
+ # will only be shown if there are checkins before this ID
6
+ # * max_id (int, optional) - The checkin ID that you want the results to start with
7
+ # * limit (int, optional) - The number of results to return, max of 50, default is 25
8
8
  def self.feed(brewery_id, options={})
9
- options.merge!({
10
- :key => Untappd::apikey,
11
- :brewery_id => brewery_id
12
- })
13
-
14
- response_to_mash get("/brewery_checkins", :query => options)
9
+ options.merge!(auth_options)
10
+ response_to_mash get("/brewery/checkins/#{brewery_id}", :query => options)
15
11
  end
16
-
17
- # This method will allow you to see extended information about a brewery.
18
- def self.info(brewery_id, options={})
19
- options.merge!({
20
- :key => Untappd::apikey,
21
- :brewery_id => brewery_id
22
- })
23
12
 
24
- response_to_mash get("/brewery_info", :query => options)
13
+ def self.info(brewery_id)
14
+ response_to_mash get("/brewery/info/#{brewery_id}", :query => auth_options)
25
15
  end
26
-
27
- #
28
- def self.search(q, options={})
29
- options.merge!({
30
- :key => Untappd::apikey,
31
- :q => q
32
- })
33
16
 
34
- response_to_mash get("/brewery_search", :query => options)
17
+ def self.search(q)
18
+ options = { :q => q }
19
+ options.merge!(auth_options)
20
+ response_to_mash get("/search/brewery", :query => options)
35
21
  end
36
-
37
22
  end
38
-
39
23
  end
40
-
41
-
@@ -1,109 +1,69 @@
1
1
  module Untappd
2
-
3
2
  class Checkin < Base
4
-
5
- def self.info(checkin_id, options={})
6
- options.merge!({
7
- :key => Untappd::apikey,
8
- :id => checkin_id
9
- })
10
-
11
- response_to_mash get("/details", :query => options)
3
+ def self.info(checkin_id)
4
+ response_to_mash get("/checkin/view/#{checkin_id}", :query => auth_options)
12
5
  end
13
-
14
- # since (optional) - The numeric ID of the last recent check-in. This provided to you in the next_query attribute.
15
- # geolat (optional) - The numeric Latitude to filter the public feed.
16
- # geolng (optional) - The numeric Longitude to filter the public feed.
17
- # offset (optional) - The offset that you like the dataset to begin with.
18
- # Each set returns 25 max records, so you can use that paginate the feed.
19
- def self.feed(options={})
20
- options.merge!({
21
- :key => Untappd::apikey
22
- })
23
6
 
7
+ # options:
8
+ # * since (int, optional) - The numeric ID of the most recent check-in.
9
+ # * lng (float, optional) - The numeric Latitude to filter the public feed.
10
+ # * lat (float, optional) - The numeric Longitude to filter the public feed.
11
+ # * radius (int, optional) - The max radius you would like the check-ins to start within
12
+ # * max_id (int, optional) - The checkin ID that you want the results to start with
13
+ # * limit (int, optional) - The number of results to return, max of 50, default is 25
14
+ def self.feed(options={})
15
+ options.merge!(auth_options)
24
16
  response_to_mash get("/thepub", :query => options)
25
17
  end
26
-
27
- # foursquare_id (optional) - The MD5 hash ID of the Venue you want to attach
28
- # the beer checkin. This HAS TO BE the MD5 non-numeric hash from the foursquare v2. Older numeric id will not be accepted.
29
- # user_lat (optional) - The numeric Latitude of the user. This is required if you add a location.
30
- # user_lng (optional) - The numeric Longitude of the user. This is required if you add a location.
31
- # shout (optional) - The text you would like to include as a comment of the checkin. Max of 140 characters.
32
- # facebook (optional) - Default = "off", Pass "on" to post to facebook
33
- # twitter (optional) - Default = "off", Pass "on" to post to twitter
34
- # foursquare (optional) - Default = "off", Pass "on" to checkin on foursquare
35
- def self.create(username, password, beer_id, options={})
36
-
37
- options.merge!({
38
- :gmt_offset => Untappd::gmt_offset,
39
- :bid => beer_id
40
- })
41
-
42
- response = post("/checkin", :query => { :key => Untappd::apikey },
43
- :body => options, :basic_auth => auth_hash(username, password))
44
-
45
- Hashie::Mash.new(response)
46
- end
47
-
48
- # foursquare_id (optional) - The MD5 hash ID of the Venue you want to attach the beer checkin.
49
- # This HAS TO BE the MD5 non-numeric hash from the foursquare v2. Older numeric id will not be accepted.
50
- # user_lat (optional) - The numeric Latitude of the user. This is required if you add a location.
51
- # user_lng (optional) - The numeric Longitude of the user. This is required if you add a location.
52
- def self.test(username, password, beer_id, options={})
53
- options.merge!({
54
- :gmt_offset => Untappd::gmt_offset,
55
- :bid => beer_id
56
- })
57
-
58
- response = post("/checkin_test", :query => { :key => Untappd::apikey },
59
- :body => options, :basic_auth => auth_hash(username, password))
60
-
61
- Hashie::Mash.new(response)
62
- end
63
-
64
- #
65
- def self.add_comment(username, password, checkin_id, comment, options={})
18
+
19
+ # options:
20
+ # * foursquare_id (optional) - The MD5 hash ID of the Venue you want to attach the beer
21
+ # checkin. This HAS TO BE the MD5 non-numeric hash from the foursquare v2.
22
+ # * timezone - user timezone, defaults to 'PST'
23
+ # * gmt_offset - calculated from the timezone, but you may override
24
+ # * geolat (optional) - The numeric Latitude of the user. This is required if you add a location.
25
+ # * geolng (optional) - The numeric Longitude of the user. This is required if you add a location.
26
+ # * shout (optional) - The text you would like to include as a comment of the checkin.
27
+ # Max of 140 characters.
28
+ # * rating (optional) - The rating score you would like to add for the beer. This can only
29
+ # be 1 to 5 and whole numbers (no 4.2)
30
+ # * facebook (optional) - Default = "off", Pass "on" to post to facebook
31
+ # * twitter (optional) - Default = "off", Pass "on" to post to twitter
32
+ # * foursquare (optional) - Default = "off", Pass "on" to checkin on foursquare
33
+ def self.create(access_token, beer_id, options={})
34
+ timezone = options.fetch(:timezone, 'PST')
35
+ gmt_offset = options.fetch(:gmt_offset, Time.zone_offset(timezone))
36
+
66
37
  options.merge!({
67
- :checkin_id => checkin_id,
68
- :comment => comment
38
+ :timezone => timezone,
39
+ :gmt_offset => gmt_offset,
40
+ :bid => beer_id
69
41
  })
70
-
71
- response_to_mash post("/add_comment", :query => { :key => Untappd::apikey },
72
- :body => options, :basic_auth => auth_hash(username, password))
42
+
43
+ response_to_mash post("/checkin/add",
44
+ :query => {:access_token => access_token},
45
+ :body => options
46
+ )
73
47
  end
74
-
75
- #
76
- def self.remove_comment(username, password, comment_id, options={})
77
- options.merge!({
78
- :comment_id => comment_id
79
- })
80
-
81
- response_to_mash post("/delete_comment", :query => { :key => Untappd::apikey },
82
- :body => options, :basic_auth => auth_hash(username, password))
48
+
49
+ def self.add_comment(access_token, checkin_id, comment)
50
+ response_to_mash post("/checkin/addcomment/#{checkin_id}",
51
+ :query => { :access_token => access_token },
52
+ :body => { :comment => comment }
53
+ )
83
54
  end
84
-
85
- #
86
- def self.toast(username, password, checkin_id, options={})
87
- options.merge!({
88
- :checkin_id => checkin_id
89
- })
90
-
91
- response_to_mash post("/toast", :query => { :key => Untappd::apikey },
92
- :body => options, :basic_auth => auth_hash(username, password))
55
+
56
+ def self.remove_comment(access_token, comment_id)
57
+ params = { :access_token => access_token }
58
+ response_to_mash post("/checkin/deletecomment/#{comment_id}", :query => params)
93
59
  end
94
-
95
- #
96
- def self.untoast(username, password, checkin_id, options={})
97
- options.merge!({
98
- :checkin_id => checkin_id
99
- })
100
-
101
- response_to_mash post("/delete_toast", :query => { :key => Untappd::apikey },
102
- :body => options, :basic_auth => auth_hash(username, password))
60
+
61
+ def self.toggle_toast(access_token, checkin_id)
62
+ params = { :access_token => access_token }
63
+ response_to_mash post("/checkin/toast/#{checkin_id}", :query => params)
103
64
  end
104
-
105
65
  end
106
-
66
+
107
67
  end
108
68
 
109
69
 
@@ -0,0 +1,28 @@
1
+ module Untappd
2
+ class << self
3
+ attr_accessor :configuration
4
+
5
+ def config
6
+ self.configuration ||= Untappd::Configuration.new
7
+ end
8
+
9
+ def reset_configuration
10
+ self.configuration = Untappd::Configuration.new
11
+ end
12
+
13
+ def configure
14
+ yield(config)
15
+ end
16
+ end
17
+ end
18
+
19
+ module Untappd
20
+ class Configuration
21
+ attr_accessor :client_id, :client_secret, :base_uri, :gmt_offset, :redirect_url
22
+
23
+ def base_uri
24
+ @base_uri || 'http://api.untappd.com/v4'
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ module Untappd
2
+ class OAuth < Base
3
+ def self.authenticate_url
4
+ raise "redirect_url not configured" unless Untappd.config.redirect_url
5
+
6
+ "https://untappd.com/oauth/authenticate/?client_id=#{Untappd.config.client_id}&response_type=token&redirect_url=#{Untappd.config.redirect_url}"
7
+ end
8
+ end
9
+ end
@@ -1,76 +1,55 @@
1
1
  module Untappd
2
-
3
2
  class User < Base
4
-
5
- def self.info(user, options={})
6
- options.merge!({
7
- :key => Untappd::apikey,
8
- :user => user
9
- })
10
-
11
- response_to_mash get("/user", :query => options)
3
+ # options:
4
+ # * max_id (int, optional) - The checkin ID that you want the results to start with
5
+ # * limit (int, optional) - The number of results to return, max of 50, default is 25
6
+ def self.feed(username, options={})
7
+ options.merge!(auth_options)
8
+ response_to_mash get("/user/checkins/#{username}", :query => options)
12
9
  end
13
-
14
- def self.badges(user, options={})
15
- options.merge!({
16
- :key => Untappd::apikey,
17
- :user => user
18
- })
19
10
 
20
- response_to_mash get("/user_badge", :query => options)
11
+ def self.info(username)
12
+ response_to_mash get("/user/info/#{username}", :query => auth_options)
21
13
  end
22
-
23
- def self.friends(user, options={})
24
- options.merge!({
25
- :key => Untappd::apikey,
26
- :user => user
27
- })
28
14
 
29
- response_to_mash get("/friends", :query => options)
15
+ # options:
16
+ # * offset (int, optional) - The numeric offset that you what results to start
17
+ def self.badges(username, options={})
18
+ options.merge!(auth_options)
19
+ response_to_mash get("/user/badges/#{username}", :query => options)
30
20
  end
31
-
32
- def self.wish_list(user, options={})
33
- options.merge!({
34
- :key => Untappd::apikey,
35
- :user => user
36
- })
37
21
 
38
- response_to_mash get("/wish_list", :query => options)
22
+ # options:
23
+ # * offset (int, optional) - The numeric offset that you what results to start
24
+ # limit (optional) - The number of records that you will return (max 50)
25
+ def self.friends(username, options={})
26
+ options.merge!(auth_options)
27
+ response_to_mash get("/user/friends/#{username}", :query => options)
39
28
  end
40
-
41
- def self.distinct(user, options={})
42
- options.merge!({
43
- :key => Untappd::apikey,
44
- :user => user
45
- })
46
29
 
47
- response_to_mash get("/distinct", :query => options)
30
+ # options:
31
+ # * offset (int, optional) - The numeric offset that you what results to start
32
+ def self.wish_list(username, options={})
33
+ options.merge!(auth_options)
34
+ response_to_mash get("/user/wishlist/#{username}", :query => options)
48
35
  end
49
-
50
- # since (optional) - The numeric ID of the last recent check-in.
51
- # offset (optional) - The offset that you like the dataset to begin with.
52
- # Each set returns 25 max records, so you can use that paginate the feed.
53
- def self.feed(user, options={})
54
- options.merge!({
55
- :key => Untappd::apikey,
56
- :user => user
57
- })
58
36
 
59
- response_to_mash get("/user_feed", :query => options)
37
+ # options:
38
+ # * sort (string, optional) - Your can sort the results using these values:
39
+ # date - sorts by date (default), checkin - sorted by highest checkin,
40
+ # global_rating - sorts by global rating, user_rating - sorted by the user's rating
41
+ # * offset (int, optional) - The numeric offset that you what results to start
42
+ def self.distinct(username, options={})
43
+ options.merge!(auth_options)
44
+ response_to_mash get("/user/beers/#{username}", :query => options)
60
45
  end
61
-
62
- # since (optional) - The numeric ID of the last recent check-in.
63
- # offset (optional) - The offset that you like the dataset to begin with.
64
- # Each set returns 25 max records, so you can use that paginate the feed.
65
- def self.friend_feed(username, password, options={})
66
- options.merge!({
67
- :key => Untappd::apikey
68
- })
69
46
 
70
- response_to_mash get("/feed", :basic_auth => auth_hash(username, password),
71
- :query => options)
47
+ # options:
48
+ # * max_id (int, optional) - The checkin ID that you want the results to start with
49
+ # * limit (int, optional) - The number of results to return, max of 50, default is 25
50
+ def self.friend_feed(access_token, options={})
51
+ options.merge!({:access_token => access_token})
52
+ response_to_mash get("/checkin/recent", :query => options)
72
53
  end
73
-
74
54
  end
75
-
76
55
  end
@@ -1,29 +1,17 @@
1
1
  module Untappd
2
-
3
2
  class Venue < Base
4
-
5
- # since (optional) - The numeric ID of the last recent check-in.
6
- # offset (optional) - The offset that you like the dataset to begin with.
7
- # Each set returns 25 max records, so you can use that paginate the feed.
3
+ # options:
4
+ # * min_id (int, optional) - The numeric ID of the most recent check-in. New results
5
+ # will only be shown if there are checkins before this ID
6
+ # * max_Id (int, optional) - The checkin ID that you want the results to start with
7
+ # * limit (int, optional) - The number of results to return, max of 50, default is 25
8
8
  def self.feed(venue_id, options={})
9
- options.merge!({
10
- :key => Untappd::apikey,
11
- :venue_id => venue_id
12
- })
13
-
14
- response_to_mash get("/venue_checkins", :query => options)
9
+ options.merge!(auth_options)
10
+ response_to_mash get("/venue/checkins/#{venue_id}", :query => options)
15
11
  end
16
-
17
- #
18
- def self.info(venue_id, options={})
19
- options.merge!({
20
- :key => Untappd::apikey,
21
- :venue_id => venue_id
22
- })
23
12
 
24
- response_to_mash get("/venue_info", :query => options)
13
+ def self.info(venue_id)
14
+ response_to_mash get("/venue/info/#{venue_id}", :query => auth_options)
25
15
  end
26
-
27
16
  end
28
-
29
17
  end
@@ -1,3 +1,3 @@
1
1
  module Untappd
2
- VERSION = "0.0.5"
2
+ VERSION = "4.0.0"
3
3
  end
@@ -1,75 +1,30 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
3
  describe "Beer" do
4
-
5
- before(:all) do
6
- Untappd.configure do |config|
7
- config.apikey = '6666666666666666666666'
8
- end
4
+ before do
5
+ configure_untappd
9
6
  end
10
-
11
- before(:each) do
12
- @response = {:results =>[]}
13
- @response.stub(:code => 200)
14
- Untappd::Beer.stub(:get => @response)
15
- end
16
-
17
- it "get feed" do
18
- @response[:results] << {:checkin_id => "610208",
19
- :beer_id => "18099",
20
- :beer_name => "Arrogant Bastard Ale",
21
- :brewery_name => "Stone Brewing Co."}
22
7
 
23
- Untappd::Beer.should_receive(:get).with("/beer_checkins", anything())
24
-
25
- checkins = Untappd::Beer.feed(18099)
26
- checkins.first.beer_name.should == "Arrogant Bastard Ale"
8
+ it "get feed", :vcr do
9
+ checkins = Untappd::Beer.feed(18099)
10
+ checkins.checkins.items.first.beer.beer_name.should == "Arrogant Bastard Ale"
27
11
  end
28
-
29
- it "get info" do
30
- @response[:results] = {:brewery_id => "1204",
31
- :beer_id => "18099",
32
- :name => "Arrogant Bastard Ale",
33
- :brewery => "Stone Brewing Co."}
34
12
 
35
- Untappd::Beer.should_receive(:get).with("/beer_info", anything())
36
-
37
- info = Untappd::Beer.info(18099)
38
- info.name.should == "Arrogant Bastard Ale"
39
- end
40
-
41
- it "get search" do
42
- @response[:results] << {:beer_id => "18099",
43
- :beer_name => "Arrogant Bastard Ale",
44
- :brewery_name => "Stone Brewing Co."}
45
-
46
- Untappd::Beer.should_receive(:get).with("/beer_search", anything())
47
-
48
- search = Untappd::Beer.search('stone')
49
- search.first.beer_name.should == "Arrogant Bastard Ale"
13
+ it "get info", :vcr do
14
+ info = Untappd::Beer.info(18099)
15
+ info.beer.beer_name.should == "Arrogant Bastard Ale"
50
16
  end
51
-
52
- it "get trending beers" do
53
- @response[:results] << {:beer_id => "18099",
54
- :beer_name => "Arrogant Bastard Ale",
55
- :brewery_name => "Stone Brewing Co."}
56
-
57
- Untappd::Beer.should_receive(:get).with("/trending", anything())
58
-
59
- trending = Untappd::Beer.trending()
60
- trending.first.beer_name.should == "Arrogant Bastard Ale"
17
+
18
+ it "get search", :vcr do
19
+ search = Untappd::Beer.search('stone')
20
+ search.beers.items.first.beer.beer_name == "Stone IPA"
21
+ search.breweries.items.first.brewery.brewery_name.should == "Stone Fly Rye"
61
22
  end
62
-
63
- end
64
23
 
65
- #beer trending JSON
66
- # {"http_code":200,"results":[{"beer_name":"Samuel Adams Noble Pils","beer_id":"5743","brewery_id":"157","count":"66","brewery_name":"Boston Beer Company","img":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-saNobilePils.jpg"},{"beer_name":"Bud Light","beer_id":"3784","brewery_id":"44","count":"55","brewery_name":"Anheuser-Busch","img":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-budLight.jpg"},{"beer_name":"Miller Lite","beer_id":"3811","brewery_id":"863","count":"55","brewery_name":"Miller Brewing Company","img":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-millerLite.jpg"},
67
-
68
- #beer checkin JSON
69
- #{"next_query":"http:\/\/api.untappd.com\/v3\/beer_checkins?bid=18099&since=610053","next_page":"http:\/\/api.untappd.com\/v3\/beer_checkins?bid=18099&offset=25","http_code":200,"results":[{"user":{"user_name":"micek","first_name":"Cory","last_name":"M.","user_avatar":"https:\/\/untappd.s3.amazonaws.com\/profile\/0d781dfce6d3acfdfbbe9f2692a0d0e4_thumb.jpg","location":"San Diego, CA","bio":"interactive designer\/developer\/creativist, obsessed with user experience, loose leaf teas and micro brews","is_friends":null,"url":""},"checkin_id":"618853","beer_id":"18099","brewery_id":"1204","beer_name":"Arrogant Bastard Ale","brewery_name":"Stone Brewing Co.","created_at":"Sat, 09 Apr 2011 05:27:09 +0000","check_in_comment":"","checkin_link":"http:\/\/untappd.com\/user\/micek\/checkin\/BETZs89","beer_stamp":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-arrogantBastardAle.jpg","venue_name":"El Take It Easy","venue_id":"272","venue_lat":"32.749","venue_lng":"-117.13"}
70
-
71
- #beer info JSON
72
- # {"http_code":200,"results":{"name":"Arrogant Bastard Ale","beer_id":"18099","brewery":"Stone Brewing Co.","brewery_id":"1204","img":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-arrogantBastardAle.jpg","total_count":"1553","unique_count":"1041","monthly_count":"193","weekly_count":"161","beer_abv":"7.2","beer_created":"Mon, 27 Dec 2010 20:34:38 +0000","type":"American Strong Ale","beer_creator":"Firmansyah","beer_creator_id":"9041"}}
24
+ it "get trending beers", :vcr do
25
+ trending = Untappd::Beer.trending
26
+ trending.macro.items.first.beer.beer_name.should == "Guinness Draught"
27
+ trending.micro.items.first.beer.beer_name.should == "Celebration Ale (2012)"
28
+ end
73
29
 
74
- #beer search JSON
75
- #{"search_term":"stone","http_code":200,"returned_results":25,"next_page":"http:\/\/api.untappd.com\/v3\/beer_search?q=stone&offset=25","results":[{"beer_id":"29100","beer_name":" Arrogant Bastard Ale Aged In Bourbon Barrels","beer_stamp":"https:\/\/untappd.s3.amazonaws.com\/site\/assets\/images\/temp\/badge-beer-default.png","brewery_id":"1204","brewery_name":"Stone Brewing Co.","brewery_stamp":"https:\/\/untappd.s3.amazonaws.com\/site\/assets\/images\/temp\/badge-brewery-default.png","country_name":"United States","total_count":"11"}
30
+ end