A Hubot-compatible Tumblr API wrapper for Node.js
Install
npm install tumblrbot
Require
Use it in your Hubot script:
= tumblr = require'tumblrbot'robot
Or use it on its own:
tumblr = require'tumblrbot'
Use
# Get the latest 3 posts tumblrposts"funblog.tumblr.com"last 3 consolelog posttitle for post in dataposts
The following options are available to help you filter by post type:
posts
, text
, quote
, link
, answer
, video
, audio
, photo
.
# Get the most recent video post tumblrvideo"funblog.tumblr.com"last consolelog dataposts0title # Or use the plural form (it's just an alias) tumblrvideos"funblog.tumblr.com"last consolelog dataposts0title # Or get it without the array tumblrvideo"funblog.tumblr.com"one consolelog posttitle
You can pass any options specified in the Tumblr API:
tumblrposts"funblog.tumblr.com"last 2 tag: "potatoes" consolelog posttitle for post in dataposts
Get a random photo post:
tumblrphoto"funblog.tumblr.com"random consolelog postphotos0original_sizeurl
Authentication
If process.env.HUBOT_TUMBLR_API_KEY
is present, you're automatically authenticated. Sweet!
Helpful Hubot
Hubot will log errors if a request fails.