0.4.1 • Published 10 years ago

tumblr v0.4.1

Weekly downloads
100
License
MIT
Repository
github
Last release
10 years ago

tumblr

NPM version Build Status Dependency Status devDependency Status

A node.js wrapper for the Tumblr API v2.

Installation

$ npm install tumblr

Examples

var tumblr = require('tumblr');

var oauth = {
  consumer_key: 'OAuth Consumer Key',
  consumer_secret: 'OAuth Consumer Secret',
  token: 'OAuth Access Token',
  token_secret: 'OAuth Access Token Secret'
};

var blog = new tumblr.Blog('blog.tumblr.com', oauth);

blog.text({limit: 2}, function(error, response) {
  if (error) {
    throw new Error(error);
  }

  console.log(response.posts);
});

var user = new tumblr.User(oauth);

user.info(function(error, response) {
  if (error) {
    throw new Error(error);
  }

  console.log(response.user);
});

Or with CoffeeScript

{Blog, User} = require 'tumblr'

oauth =
  consumer_key: 'OAuth Consumer Key'
  consumer_secret: 'OAuth Consumer Secret'
  token: 'OAuth Access Token'
  token_secret: 'OAuth Access Token Secret'

blog = new Blog 'blog.tumblr.com', oauth

blog.text limit: 2, (error, response) ->
  throw new Error error if error
  console.log response.posts

user = new User oauth

user.info (error, response) ->
  throw new Error error if error
  console.log response.user

API

Blog

  • info(callback)
  • avatar([size, ]callback)
  • followers([options, ]callback)
  • likes([options, ]callback)
  • posts([options, ]callback)
  • text([options, ]callback)
  • quote([options, ]callback)
  • link([options, ]callback)
  • answer([options, ]callback)
  • video([options, ]callback)
  • audio([options, ]callback)
  • photo([options, ]callback)

Options list please refer to Tumblr API v2 - Blog Methods

User

  • info(callback)
  • dashboard([options, ]callback)
  • likes([options, ]callback)
  • following([options, ]callback)

Options list please refer to Tumblr API v2 - User Methods

Tagged

  • search(tag[, options], callback)

Options list please refer to Tumblr API v2 - Tagged Methods

Contributing

DO NOT directly modify the lib files. These files are automatically built from CoffeeScript sources located under the src directory.

To do build run:

npm run build

Credits

Big thanks to all contributors.

License

The MIT License, see the included license.md file.

Bitdeli Badge

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago