Git Product home page Git Product logo

tumblrrr's Introduction

Tumblrrr

A Node.JS wrapper for Tumblr's API.

v0.2.0

Demo

var tumblr = require('tumblrrr'),
	staff = tumblr('staff');

staff.read('account', function(data){
	console.log('Title: ' + data['Title']);
});

Usage

var tumblr = require('tumblrrr'),
    you = tumblr('you');

For POST-like methods you must pass email and password, otherwise it will return false. If the email or the password are incorrect it will return HTTP 403 (not authorized).

var tumblr = require('tumblrrr'),
	you = tumblr('you', '[email protected]', 'password');

Methods:

read

you.read([ read_api ], [ query ], callback(data));

If read_api isn't set it will return data from /api/dashboard/json only if email and password are set, if they are not it returns data from /api/read/json.

  • read_api

    • account
    • posts
    • dashboard
  • query

delete

you.delete(id, callback);

reblog

you.reblog([ id, key ], callback);

you.reblog([ obj ], callback);

  • obj

  • { id : number, key : 'string' [ , comment : 'string', as : 'string' ] }

like

you.like([ id, key ], callback);

you.like([ obj ], callback);

  • obj

  • { id : number, key : 'string' }

unlike

you.unlike([ id, key ], callback);

you.unlike([ obj ], callback);

  • obj

  • { id : number, key : 'string' }

write

you.write(obj, callback);

  • For info about obj see this.

edit

you.edit(obj, callback)

  • If post-id isn't set, it will return false.
  • You must pass all content parameters for the post's type (e.g. title, body for text posts) even if you are not changing their values.
  • For more info about obj see this.

Debugging:

tumblr.debug = true

Info

  • Under maintenance, Tumblr will return HTTP 503.
  • When sending queries, id is an alias for post-id just like key is for reblog-key.
  • If a non-optional parameter isn't set when sending the query, it will return false.
  • Issues
    • Data from /api/authenticate and /api/likes are only available in XML and for now I don't want to be in any way dependent of other modules. Again: this is just for now.
    • /api/read/json has often not been accessible, if that occurs the client will trigger an event error and it will return false when trying to connect.

Future

  • The Debugging system.
  • Maybe working on a better syntax.
  • Got some more ideas? Fork it, or let me know: [email protected]

License

See LICENSE

tumblrrr's People

Contributors

mvrilo avatar slaskis avatar

Stargazers

 avatar

Watchers

 avatar James Cloos 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.