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,107 +0,0 @@
1
- == untappd API
2
-
3
- Wrapper around the Untappd API. This organizes the untappd api
4
- into proper RESTFUL objects. See API coverage below for mapping from
5
- the API documentation.
6
-
7
- * You will need to register for an API key: http://untappd.com/api/register
8
- * Attempting to wrap all the API documented here: http://untappd.com/api/docs/v3
9
- * All options can be passed into the calls
10
- * Untappd v3 doesn't support oauth so you must pass your username and password
11
- * passwords are md5 hashed before they sent over the wire
12
- * all returns are wrapped in a Hashie::Mash
13
-
14
- == Releases
15
-
16
- * 0.0.5 Brewery Info and Search
17
- * 0.0.4 Complete coverage of v3 API. Checkins, Comments, Toasts, gmt_offset configuration
18
- * 0.0.3 Venue Info & Feed, Trending Beer, Brewery Feed, Checkin info & Feed (the pub), Renamed Beer.checkins to Beer.feed
19
- * 0.0.2 User feed, distinct beers, info, badges, friends, wish list
20
- * 0.0.1 Beer Search, Info and Checkins
21
-
22
- == API Coverage
23
-
24
- Beer Object
25
- * Beer Feed - Untappd::Beer.feed(beer_id, options={})
26
- * Beer Info - Untappd::Beer.info(beer_id, options={})
27
- * Beer Search - Untappd::Beer.search(q, options={})
28
- * Trending - Untappd::Beer.trending(options={})
29
-
30
- User Object
31
- * User Feed - Untappd::User.feed(user, options={})
32
- * User Info - Untappd::User.info(user, options={})
33
- * User Badges - Untappd::User.badges(user, options={})
34
- * User Friends - Untappd::User.friends(user, options={})
35
- * User Wish List - Untappd::User.wish_list(user, options={})
36
- * User Distinct Beers - Untappd::User.distinct(user, options={})
37
- * Friend Feed - Untappd::User.friend_feed(username, password, options={})
38
-
39
- Venue Object
40
- * Venue Feed - Untappd::Venue.feed(venue_id, options={})
41
- * Venue Info - Untappd::Venue.info(venue_id, options={})
42
-
43
- Brewery Object
44
- * Brewery Checkins - Untappd::Brewery.feed(brewery_id, options={})
45
- * Brewery Info - Untappd::Brewery.info(brewery_id, options={})
46
- * Brewery Search - Untappd::Brewery.search(q, options={})
47
-
48
- Checkin Object
49
- * The Pub Feed - Untappd::Checkin.feed(options={})
50
- * Checkin Info - Untappd::Checkin.info(checkin_id, options={})
51
- * Checkin (Test) - Untappd::Checkin.test(username, password, beer_id, options={})
52
- * Checkin - Untappd::Checkin.create(username, password, beer_id, options={})
53
- * Add Comment - Untappd::Checkin.add_comment(username, password, checkin_id, comment)
54
- * Remove Comment - Untappd::Checkin.remove_comment(username, password, comment_id)
55
- * Toast - Untappd::Checkin.toast(username, password, checkin_id)
56
- * Remove Toast - Untappd::Checkin.untoast(username, password, checkin_id)
57
-
58
-
59
- == Examples
60
- Add to your GemFile
61
-
62
- gem 'untappd'
63
-
64
- Configure your API KEY
65
-
66
- Untappd.configure do |config|
67
- config.apikey = 'YOUR_API_KEY'
68
- config.gmt_offset = -5
69
- end
70
-
71
- Get all the checkins for Arrogant Bastard Ale
72
-
73
- checkins = Untappd::Beer.feed(18099) # or Untappd::User.feed("cmar")
74
- checkins.each do |checkin|
75
- puts "#{checkin.user.first_name} at #{checkin.created_at}"
76
- end
77
-
78
- Create Checkin
79
- #foursqure, lat, lng are optional
80
- Untappd::Checkin.create("cmar", "PASSWORD", 4665,
81
- :foursquare_id => "4ad6bf91f964a520380821e3",
82
- :user_lat => "51.4718",
83
- :user_lng => "-0.489278")
84
-
85
- Search for beers with the name Stone
86
-
87
- beers = Untappd::Beer.search('stone')
88
- beers.each do |beer|
89
- puts "#{beer.beer_name}"
90
- end
91
-
92
- Get extended info for Arrogant Bastard Ale
93
-
94
- info = Untappd::Beer.info(18099)
95
- puts "#{info.name} by #{info.brewery}"
96
-
97
- All Methods can take additional options specified in the API
98
-
99
- checkins = Untappd::Beer.checkins(18099, :offset => 100)
100
-
101
- beers = Untappd::Beer.search('stone', :sort => "count")
102
-
103
- == Debugging
104
- You can dump any result to see what values are available with
105
-
106
- info = Untappd::Beer.info(18099)
107
- puts info.inspect
@@ -1,13 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe "Untappd" do
4
-
5
- it "should configure Rails initializer style" do
6
- Untappd.configure do |config|
7
- config.apikey = 'c01822f029486661bb3669a845b5ec14'
8
- end
9
-
10
- Untappd.apikey.should eq 'c01822f029486661bb3669a845b5ec14'
11
- end
12
-
13
- end