Skip to content

Instantly share code, notes, and snippets.

@hSATAC
Forked from monde/.gitignore
Last active August 29, 2015 14:28
Show Gist options
  • Select an option

  • Save hSATAC/716c6f48e8425d399724 to your computer and use it in GitHub Desktop.

Select an option

Save hSATAC/716c6f48e8425d399724 to your computer and use it in GitHub Desktop.
Micro Gem to get an OAuth token and secret for the Tumblr.com API allowing an external application to post Tumblr.com blog.

Generate a OAuth token and secret for the Tumblr.com API

This is a micro Gem to get an OAuth token and secret for the Tumblr.com API allowing an external application to post Tumblr.com blog.

Make a directory, cd into it, download the microgem's Gemfile and run bundle install

mkdir /path/to/some/new/dir
cd /path/to/some/new/dir
wget https://gist.github.com/raw/4577106/6bc9befedcd5238ce9f2ee562cace666dece460c/Gemfile
bundle install

Go to the Tumblr OAuth Applications panel, http://www.tumblr.com/oauth/apps, log in if prompted.

Click the "+ Register application" button to grant access to your application and fill in the following to register a new application. Unless you know otherwise, use this URL for the "Default callback URL" http://sasquatch.github.com/tumblr.html

  • Application name
  • Application website
  • Application description
  • Administrative contact email
  • Default callback URL

Click "Register" and you'll be redirected back to http://www.tumblr.com/oauth/apps . Make note of your new "OAuth Consumer Key" and "Show secret key / Secret Key" for the application you've just registered.

Now generate OAuth token and secret that your application will use to post to your tumblr in the following manner.

bundle exec generate
source "http://rubygems.org"
gem "generate-tumblr-oauth-token", :git => "https://gist.github.com/4577106.git"
gem "oauth"
#!/usr/bin/env ruby
require 'generate-tumblr-oauth-token.rb'
puts "running generate"
Gem::Specification.new do |s|
s.name = 'generate-tumblr-oauth-token'
s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.author = 'Mike Mondragon'
s.email = 'mikemondragon@gmail.com'
s.summary = 'Generate a OAuth token and secret for the Tumblr.com API'
s.description = 'This is a micro Gem to get an OAuth token and secret for the Tumblr.com API allowing an external application to post Tumblr.com blog.'
s.files = ['generate-tumblr-oauth-token.rb', 'generate']
s.require_path = '.'
s.bindir = '.'
s.executables << 'generate'
end
require 'pp'
require 'rubygems'
require 'bundler/setup'
require 'oauth'
puts "loaded generate-tumblr-oauth-token.rb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment