npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-untappd

v0.6.1

Published

NodeJS API to the Untappd Service

Downloads

25

Readme

node-untappd

NodeJS API to intergrate with Untappd API.

Untappd is a social beer tracking application for most mobile devices and the greater internet at large. It supports a robust set of features for "checking into" beer as it is consumed including locations, ratings, comments, and social integration.

This library provides NodeJS with an abstraction to the Untappd API allowing developers to query and integrate Untappd services into their own applications.

This library nor the authors have any formal relationship with Untappd other than the beer we drink.

Build Status

Build Status

Getting Started

  1. If you have never done so, sign up for Untappd and download it to your favorite mobile device.
  2. Have a nice craft beer and make sure to Checkin.
  3. You need to get yourself an Untappd ClientID and ClientSecret. To do so, go complete the Untappd API Key Form.
  4. Have more nice craft beer, make more checkins.
  5. Wait for Untappd to email you your key. This takes around two (2) business days.
  6. Download node-untappd: npm install node-untappd
  7. Look at the Example, beer is optional but encouraged.

Access Tokens

Untappd now support OAUTH for most operations and specifically for any operation that writes data to untappd.

To get an Access Token, you can use our handy OAUTH URL call to get the untappd oauth url, and then use that to get the access token. For more information on getting access tokens, please refer to Untappd's API Authentication page.

The Example code

The Example.js file provides a very simple example for working with UntappdClient.

To use Example.js...

  1. Set your CLIENT ID on line 12.
  2. Set your CLIENT SECRET on line 15.

To run the example:

node Example.js

Basic Usage

There are four parts to using node-untappd:

Import the library:

var UntappdClient = require("node-untappd");

Creating the client:

var debug = false;
var untappd = new UntappdClient(debug);

Set your credientials

var clientId = "[ your api key goes here ]"; // Replace this with your CLIENT ID
var clientSecret = "[ your client secret goes here ]"; // Replace this with your CLIENT SECRET
var accessToken = "[ your access token goes here ]"; // Replace this with an Access Token, Optional

untappd.setClientId(clientId);
untappd.setClientSecret(clientSecret);
untappd.setAccessToken(accessToken); // Optional

Executing API calls, for example:

var data = {};
data.USERNAME = "[ some user name ]";
untappd.userActivityFeed(function(err, obj) {
	var beers = obj.results.forEach(function(checkin) {
		console.log(username, "drank", checkin.beer_name);
		console.log("by", checkin.brewery_name);
		if (checkin.venue_name)
			console.log("at", checkin.venue_name);
		console.log("on", checkin.created_at);
	});
}, data);

API Calls

All of the API calls defined in the Untappd API have been implemented into the UntappdClient. It's a long list, so please look at UntappdClient for usage.

Each API call takes a callback function as its first argument. Upon a result this function is called with err as the first parameter and obj, an object of the results, as the second.

function(err,obj)

The err is only populated if an error occurs, otherwise it is null.

The obj will be populated with the object returned from Untappd upon completion of the call. In some cases where an error occurs, both err and obj will be populated.

Going beyond the API

We are providing only the most basic API. Please use it and take it to strange and wonderful new places. Also, please share what you have done with us, any suggestions you have with us, and by all means any bugs you find with us. We are eager to hear from you and, more importantly, score free beer from you.

If you are using node-untappd somewhere in production, I'd love to share it out. Please let me know!