0.0
No commit activity in last 3 years
No release in over 3 years
See summary
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

drink-socially

Build Status Dependency Status Code Climate Buggerall

A gem for interfacing with the Untappd API

Requirements

Ruby 1.9

Usage

Acting as a person

require 'drink-socially'

# Per-user access token taken from OAuth
brundage = NRB::Untappd::API.new access_token: 'BEER7A23A881D2580E&CEFC405C60693AC476AA'

new_republic = brundage.brewery_info brewery_id: 8767
=> #<Hashie::Mash beer_count=13 beer_list=....

new_republic.attributes.sort
 => [:beer_count, :beer_list, :brewery_description, :brewery_id, :brewery_in_production, :brewery_label, :brewery_name, :brewery_type, :checkins, :claimed_status, :contact, :country_name, :location, :media, :rating, :stats] 


new_republic.brewery_name
 => "New Republic Brewing Company" 

Acting as an app

# Get your id & secret from http://untappd.com/api/dashboard
new_republic_app = NRB::Untappd::API.new client_id: 'beer645c10bc59f30e34d6fd265cfdeb75e', client_secret: '9ffe686c814207df12f9b0e0bc0cdabeer'

Methods

NRB::Untappd::API

new takes a user access token or a application id and secret. Once you have an instance of the API you can make calls on behalf of the user or application.

The Untappd api enforces a rate limit per token. After the first call you can ask your object the current limit with rate_limit.

brundage.rate_limit
 => @rate_limit= #<NRB::Untappd::API::RateLimit:0x930af6c @limit="100", @remaining="99">>

API calls return an NRB::Untappd::API::Object, which is mostly a Hashie::Mash.

Documentation for the API calls are detailed in the wiki. Also have a look at the Untappd v4 API documentation for details.

NRB::Untappd::API::Object

Responses from the API are marshalled into NRB::Untappd::API::Object instances.