untappd 0.0.5 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +23 -15
- data/README.md +137 -0
- data/Rakefile +7 -2
- data/examples/aba_checkins.rb +5 -41
- data/examples/checkin.rb +10 -11
- data/examples/user_feed.rb +5 -4
- data/lib/untappd.rb +4 -23
- data/lib/untappd/base.rb +11 -9
- data/lib/untappd/beer.rb +20 -44
- data/lib/untappd/brewery.rb +13 -31
- data/lib/untappd/checkin.rb +53 -93
- data/lib/untappd/config.rb +28 -0
- data/lib/untappd/oauth.rb +9 -0
- data/lib/untappd/user.rb +38 -59
- data/lib/untappd/venue.rb +9 -21
- data/lib/untappd/version.rb +1 -1
- data/spec/beer_spec.rb +19 -64
- data/spec/brewery_spec.rb +12 -49
- data/spec/checkin_spec.rb +29 -75
- data/spec/config_spec.rb +17 -0
- data/spec/oauth_spec.rb +17 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/user_spec.rb +26 -108
- data/spec/vcr/Beer/get_feed.yml +239 -0
- data/spec/vcr/Beer/get_info.yml +186 -0
- data/spec/vcr/Beer/get_search.yml +324 -0
- data/spec/vcr/Beer/get_trending_beers.yml +108 -0
- data/spec/vcr/Brewery/get_feed.yml +219 -0
- data/spec/vcr/Brewery/get_info.yml +372 -0
- data/spec/vcr/Brewery/get_search.yml +51 -0
- data/spec/vcr/Checkin/get/gets_info.yml +49 -0
- data/spec/vcr/Checkin/get/gets_thepub_feed.yml +240 -0
- data/spec/vcr/Checkin/post/add_comment.yml +47 -0
- data/spec/vcr/Checkin/post/adds_toast.yml +45 -0
- data/spec/vcr/Checkin/post/creates_checkin.yml +53 -0
- data/spec/vcr/Checkin/post/removes_comment.yml +46 -0
- data/spec/vcr/Checkin/post/removes_toast.yml +44 -0
- data/spec/vcr/User/get_badges.yml +45 -0
- data/spec/vcr/User/get_distinct_beers.yml +82 -0
- data/spec/vcr/User/get_feed.yml +78 -0
- data/spec/vcr/User/get_friend_feed.yml +460 -0
- data/spec/vcr/User/get_friends.yml +43 -0
- data/spec/vcr/User/get_info.yml +109 -0
- data/spec/vcr/User/get_wish_list.yml +47 -0
- data/spec/vcr/Venue/gets_info.yml +67 -0
- data/spec/vcr/Venue/gets_the_feed.yml +65 -0
- data/spec/venue_spec.rb +8 -36
- data/untappd.gemspec +3 -1
- metadata +146 -78
- data/README.rdoc +0 -107
- data/spec/untappd_spec.rb +0 -13
data/lib/untappd/brewery.rb
CHANGED
@@ -1,41 +1,23 @@
|
|
1
1
|
module Untappd
|
2
|
-
|
3
2
|
class Brewery < Base
|
4
|
-
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
data/lib/untappd/checkin.rb
CHANGED
@@ -1,109 +1,69 @@
|
|
1
1
|
module Untappd
|
2
|
-
|
3
2
|
class Checkin < Base
|
4
|
-
|
5
|
-
|
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
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
:
|
68
|
-
:
|
38
|
+
:timezone => timezone,
|
39
|
+
:gmt_offset => gmt_offset,
|
40
|
+
:bid => beer_id
|
69
41
|
})
|
70
|
-
|
71
|
-
response_to_mash post("/
|
72
|
-
|
42
|
+
|
43
|
+
response_to_mash post("/checkin/add",
|
44
|
+
:query => {:access_token => access_token},
|
45
|
+
:body => options
|
46
|
+
)
|
73
47
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
:
|
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
|
-
|
87
|
-
|
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
|
-
|
97
|
-
|
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
|
data/lib/untappd/user.rb
CHANGED
@@ -1,76 +1,55 @@
|
|
1
1
|
module Untappd
|
2
|
-
|
3
2
|
class User < Base
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
71
|
-
|
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
|
data/lib/untappd/venue.rb
CHANGED
@@ -1,29 +1,17 @@
|
|
1
1
|
module Untappd
|
2
|
-
|
3
2
|
class Venue < Base
|
4
|
-
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
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
|
-
|
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
|
-
|
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
|
data/lib/untappd/version.rb
CHANGED
data/spec/beer_spec.rb
CHANGED
@@ -1,75 +1,30 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
2
|
|
3
3
|
describe "Beer" do
|
4
|
-
|
5
|
-
|
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
|
-
|
24
|
-
|
25
|
-
checkins
|
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
|
-
|
36
|
-
|
37
|
-
info
|
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
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
|
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
|