tumblr-posts

Easily retrieve and embed the latest posts from your tumblr blog.

tumblr-posts

Easily retrieve and embed the latest posts from your tumblr blog.

Here's an example of how you might use tumblr-latest with browserify and brfs:

var TumblrPosts = require('tumblr-posts');
var Handlebars = require('handlebars');
var fs = require('fs');
 
var latest = new TumblrLatest({
  blog: 'seattleio.tumblr.com',
  key: 'YOUR API KEY',
  template: Handlebars.compile(fs.readFileSync('./post.html', 'utf8'))
});
 
var container = document.createElement('div');
container.id = 'latest-tumblr-posts';
document.body.appendChild(container);
 
latest.appendTo('latest-tumblr-posts', function (errposts) {
  console.log(err, posts);
});

And an example of using the getPosts method if you just want to work with the raw json results of posts:

var TumblrPosts = require('tumblr-posts');
 
var latest = new TumblrLatest({
  blog: 'seattleio.tumblr.com',
  key: 'YOUR API KEY',
});
 
latest.getPosts(function (errposts) {
  console.log(err, posts);
});

MIT