Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript">
- $(function(){
- var your_blog = "your_blog_url_here";
- var which_posts = [
- "post_id1",
- "post_id2",
- "post_id3"]
- document.write (
- '<div id="loading">'+
- '<a href="#">Waiting ...</a>'+
- '</div>' +
- '<div id="content">' +
- '</div>'
- );
- tumblr_callback = function(data)
- {
- /* console.log(data); */
- $("#content").append(data.response.posts[0].title + '<br />');
- for (var i=0, l = data.response.posts[0].notes.length; i<l; i++) {
- if (data.response.posts[0].notes[i].type == "reblog") {
- output = data.response.posts[0].notes[i].blog_name+': <a href="'+data.response.posts[0].notes[i].blog_url+'post/'+data.response.posts[0].notes[i].post_id+'/">'+data.response.posts[0].notes[i].added_text+'</a><br />';
- $("#content").append(output);
- }
- $("#loading").html('');
- };
- $("#content").append('<hr />');
- }
- for (var i=0, l = which_posts.length; i<l; i++) {
- jQuery.ajax({
- type: "GET",
- url : "http://api.tumblr.com/v2/blog/"+your_blog+".tumblr.com/posts",
- dataType: "jsonp",
- data: {
- api_key : "PyezS3Q4Smivb24d9SzZGYSuhMNPQUhMsVetMC9ksuGPkK1BTt",
- notes_info : true,
- id : which_posts[i],
- jsonp : "tumblr_callback"
- }
- });
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment