Guest User

Tumblr RP thread Tracker

a guest
Nov 15th, 2012
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. $(function(){
  4.  
  5. var your_blog = "your_blog_url_here";
  6. var which_posts = [
  7. "post_id1",
  8. "post_id2",
  9. "post_id3"]
  10.  
  11. document.write (
  12.     '<div id="loading">'+
  13.     '<a href="#">Waiting ...</a>'+
  14.     '</div>' +
  15.     '<div id="content">' +
  16.     '</div>'
  17. );
  18.  
  19. tumblr_callback = function(data)
  20. {
  21.     /* console.log(data); */
  22.     $("#content").append(data.response.posts[0].title + '<br />');
  23.     for (var i=0, l = data.response.posts[0].notes.length; i<l; i++) {
  24.         if (data.response.posts[0].notes[i].type == "reblog") {
  25.             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 />';
  26.             $("#content").append(output);
  27.         }
  28.         $("#loading").html('');
  29.     };
  30.         $("#content").append('<hr />');
  31. }
  32.  
  33. for (var i=0, l = which_posts.length; i<l; i++) {
  34.     jQuery.ajax({
  35.         type: "GET",
  36.         url : "http://api.tumblr.com/v2/blog/"+your_blog+".tumblr.com/posts",
  37.         dataType: "jsonp",
  38.         data: {
  39.             api_key : "PyezS3Q4Smivb24d9SzZGYSuhMNPQUhMsVetMC9ksuGPkK1BTt",
  40.             notes_info : true,
  41.             id : which_posts[i],
  42.             jsonp : "tumblr_callback"
  43.         }
  44.     });
  45. }
  46. });
  47.  
  48. </script>
Advertisement
Add Comment
Please, Sign In to add comment