GithubHelp home page GithubHelp logo

meritt / node-tumblr Goto Github PK

View Code? Open in Web Editor NEW
174.0 9.0 27.0 299 KB

A node.js wrapper for the Tumblr API

Home Page: http://simonenko.su/projects/node-tumblr

License: MIT License

CoffeeScript 55.54% JavaScript 44.46%

node-tumblr's Introduction

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

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.