Giter Club home page Giter Club logo

tumblr's Introduction

tumblr

Ruby wrapper and command line tool for the Tumblr API. In case there weren't enough of those already. This one is powered by the Weary gem.

RDoc | Gem | Metrics

Installation

gem install tumblr-rb

Usage

$: tumblr path/to/a_post.markdown
Email Address: [email protected]
Password:	
Published to Tumblr. The ID for this post is: 123456789

You can pass tumblr something from standard input, but you have to set your email and password as arguments:

$: echo 'Hello world.' | tumblr -a [email protected]:supers3cretp4ssw0rd
Published to Tumblr. The ID for this post is: 123456790

Or the credentials can come from a YAML file:

$ cat ~/.tumblrlogin
email: [email protected]
password: myvoiceismypassport
$ echo 'Hello world. | tumblr --credentials ~/.tumblrlogin

Try tumblr --help if you are in need of guidance. Read tumblr(1) for more information.

Getting Started

Like Jekyll, and Mustache, Tumblr gem will transform documents preceded by a YAML frontmatter block.

YAML frontmatter beings with --- on a single line, followed by YAML, ending with another --- on a single line, e.g.

---
type: quote
source: Billy Shakespeare
state: draft
tags: hamlet, shakespeare
---
"To be or not to be."

Understood YAML parameters are taken from the Tumblr API: http://www.tumblr.com/docs/en/api#api_write

Read tumblr(5) for more info.

All Posts

type				regular, photo, link, quote, conversation, video, audio
					will take a guess if ommitted.
		
state				published, queue, draft, submission

format				html or markdown

tags				comma-separated list of tags

date    			post date

private				true if the post is private

slug				A custom string to appear in the post's URL

group				id for a secondary blog

generator			description of the publishing application

send-to-twitter		Twitter status update if the tumblelog has enabled it

publish-on			if the post state is 'queue', publish on this date

Additional parameters for specific Post Types

regular			title

photo			caption, click-through-url

quote			source

link			name, description

conversation	title

video			title, caption

audio			caption

To publish to Tumblr, do this:

request = Tumblr.new(username, password).post(document)
request.perform do |response|
	if response.success?
		puts response.body 	# Returns the new post's id.
	else
		puts "Something went wrong: #{response.code} #{response.message}"
	end
end

Goals

  • Full API coverage. Leave no method behind.
  • Well tested. Like a good Rubyist.
  • Obnoxiously simple CLI. *nix idioms are wonderful.
  • Kind-of-sort-of proof-of-concept for Weary.

TODO:

  • File-uploading for Photos, Videos, Audio (needs to get into Weary)

Copyright

The Tumblr gem is Copyright (c) 2010 Mark Wunsch and is licensed under the MIT License.

Tumblr is Copyright (c) Tumblr, Inc. The Tumblr gem is NOT affiliated with Tumblr, Inc.

tumblr's People

Contributors

mwunsch avatar pengwynn avatar

Stargazers

Jon Austin avatar Richard Metzler avatar Christopher Mayfield avatar Rupak Ganguly avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.