Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
appbites
2,949 PointsTumblr API - integrating Tumblr on my website - not sure how.
I want to implement tumblr to my blog using Tumblr API. I have got my OAuth Key already.
I am not quiet sure how to start implementing this to my site. I want use JavaScript as an API Client so I headed to GitHub to check it out ( link to Tumblr API JS Client ).
What will be the next step? I see few files there and library, do I need all of them?
1 Answer
Randy Hoyt
Treehouse Guest TeacherI haven't worked with the Tumblr API specifically, but it looks like you'll need to get your credentials from your Tumblr account. You'll need to set up an OAuth workflow to get the keys you need. (I've seen people online commenting that using the Ruby app is the easiest way to get those credentials.) Then you just follow their example, replacing your information with the fields on the site:
var tumblr = require('tumblr.js');
var client = tumblr.createClient({
consumer_key: '<consumer key>',
consumer_secret: '<consumer secret>',
token: '<oauth token>',
token_secret: '<oauth token secret>'
});
// Show user's blog names
client.userInfo(function (err, data) {
data.blogs.forEach(function (blog) {
console.log(blog.name);
});
});
(I believe this assumes that you'll have something like require.js running in the page to handle including it. I can't seem to find an example without it.)
Does that help at all?