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

tumblr-auto-auth

v0.2.0

Published

Automatic oauth-authenticated tumblr client creation tool

Downloads

4

Readme

tumblr-auto-auth

Automatic oauth-authenticated tumblr client creation tool.

Overview

Module provides two ways to complete the 3-legged oauth process with minimal efforts and returns authenticated tumblr.js client instance to callback.

Installation

  1. Install module via node package manager:

    npm install tumblr-auto-auth

  2. Register application with tumblr.

2.1. Visit registration form.

2.2. Fill form with data:

  • application name: tumblr-auto-auth
  • application website: https://github.com/chesco-als/tumblr-auto-auth
  • administrative contact email: fill in your email address
  • default callback URL: http://localhost:9992/tumblr-auth

2.3. Note OAuth Consumer Key and Secret Keyfrom your account apps page.

Usage

Hands free way

This method isn't considered as reliable. In a long-term perspective especially. Sometime tumblr responds with "page not found" code or request timeout can be too long or tumblr html code contains some irregularities and it fails accomplishment of the authentication process.

Once process is done, received keys stored to file named .{your@email}.keys and used till expiration occurs.

require('tumblr-auto-auth').getAuthorizedClient({
		userEmail: "your@email",
		userPassword: "Your_Tumblr_Password",
		appConsumerKey: "OAuth_Consumer_Key",
		appSecretKey: "Secret_Key",
		debug: true
	},
	function (error, client) {
		if (!error) {
			client.userInfo(function (error, data) {
				console.log(data);
			});
		}
		else {
			console.log(error);
		}
	});

If process completed successfully, callback fired with fully-featured tumblr client as an argument. Refer to tumblr.js page and tumblr API documentation for the client's possibilities reference.

One hand way

This is reliable way for oauth keys obtaining. It involves some user actions but doesn't involve user account password. Once process is done, received keys stored to file named .{your@email}.keys and can be used by getAuthorizedClient method automatically.

require('tumblr-auto-auth').interactiveAuthorization({
		userEmail: "your@email",
		appConsumerKey: "OAuth_Consumer_Key",
		appSecretKey: "Secret_Key",
		debug: true
	},
	function (error, client) {
		client.userInfo(...)
	});

Follow the instructions of console and browser output.

After interactiveAuthorization method done, received keys will be stored to file named .{your@email}.keys and will be used by getAuthorizedClient method automatically.

.{your@email}.keys file

File will be created (updated if keys become invalid) after authorization method completed. Keep them safe. Once file created, getAuthorizedClient will try to use it first before new authentication process will be started. Following code can be used till keys in file stay valid (no password required).

require('tumblr-auto-auth').getAuthorizedClient({
		userEmail: "your@email",
		appConsumerKey: "OAuth_Consumer_Key",
		appSecretKey: "Secret_Key"
	},
	function (error, client) {
		client.userInfo(...)
	});