Posted By

tessat on 09/23/10


Tagged

tumblr


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kantiano


Tumblr - load all posts


 / Published in: jQuery
 

Very rudimentary script for loading all posts on a tumblr blog at the same time. Needs a lot of work, just a concept really.

  1. //Presumes your posts code is inside a div "#posts" and ".page" inside this.
  2.  
  3. $(document).ready(function() {
  4. var totalPages = $("#hidden_navinfo .totalpages").text();
  5. for ( var i = 1, len = totalPages; i < len; i++) {
  6. var count = i+1;
  7. var new_posts = "";
  8. $.get("/page/" + count, function(data) {
  9. $("#posts").append($('.page', $(data)));
  10. });
  11.  
  12. }
  13. });
  14.  
  15.  
  16. // This needs to go in the the page div
  17. <div id="hidden_navinfo"><span class="totalpages">{TotalPages}</span></div>

Report this snippet  

You need to login to post a comment.