document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <!-- place this code on a page in your blog -->
  2. <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  3. <script type="text/javascript">
  4.  
  5. // Posts in chronological order from feed / MS-potilas 2011 yabtb.blogspot.com
  6. // Configuration:
  7.  
  8. var maxResults = 500;  // 1-500 (500 is max possible)
  9. var numPerPage = 7;    // post per page, number or "all"
  10. var feedURI = "/feeds/posts/default";
  11. // full url could be used, too (read from another blog):
  12. // var feedURI = "http://yabtb.blogspot.com/feeds/posts/default";
  13.  
  14. google.load("feeds", "1");
  15. var theResult = null;
  16. feedURI = feedURI + "?max-results="+maxResults+"&redirect=false";
  17. var goodGoogle = google;
  18.  
  19. function doThings()
  20. {
  21.     google = goodGoogle;
  22.     var result = theResult;
  23.     if (!result.error) {
  24.         var container = document.getElementById("feedDiv");
  25.         container.innerHTML = "";
  26.         var strBuffer= "";
  27.         var j = 0;
  28.         var base = parseInt(window.location.hash.replace("#", ""));
  29.         if(isNaN(base) || !base) base = 0;
  30.         if(window.location.hash == "#all" || window.location.hash == "all" || numPerPage == "all")
  31.             numPerPage = result.feed.entries.length;
  32.         for (var i = result.feed.entries.length-1-base; j < numPerPage && i >= 0; i--) {
  33.             var entry = result.feed.entries[i];
  34.  
  35.             postDate = new Date(entry.publishedDate);
  36.             strBuffer = strBuffer + "<h2 class=\\"date-header\\">" + postDate.toDateString() + "</h2>";
  37.             strBuffer = strBuffer + "<h3 class=\\"post-title entry-title\\"><a href=\\"" + entry.link + "\\">"+ entry.title + "</a></h3><br />";
  38.             strBuffer = strBuffer + entry.content + "<div class=\\"post-footer-line post-footer-line-1\\"><div class=\\"post-footer\\">";
  39.             strBuffer = strBuffer + "Posted by " + entry.author + " at " + postDate.getHours() + ":" + (postDate.getMinutes() < 10 ? "0":"") + postDate.getMinutes();
  40.             strBuffer = strBuffer + " &nbsp; &nbsp; <a href=\\"" + entry.link + "#comments\\">Comments</a>";
  41.             if(entry.categories.length) {
  42.                 strBuffer = strBuffer + "<br />Labels: ";
  43.                 for(var z = 0 ; z < entry.categories.length ; z++) {
  44.                     if(z) strBuffer = strBuffer + ", ";
  45.                     strBuffer = strBuffer + "<a href=\\"/search/label/" + encodeURIComponent(entry.categories[z]) + "\\">" + entry.categories[z] + "</a>";
  46.                 }
  47.             }
  48.             strBuffer = strBuffer + "</div></div><br /><br />";
  49.             j++;
  50.         }
  51.         strBuffer = strBuffer + "<div style=\\"margin-bottom: -1.5em; text-align: center\\"><a onclick=\\"setTimeout(doThings,500)\\" href=\\"#0\\">First Post</a></div>";
  52.         strBuffer = strBuffer + "<div>";
  53.         if(i>0) strBuffer = strBuffer + "<a onclick=\\"setTimeout(doThings,500)\\" href=\\"#" + (base + numPerPage) + "\\">Newer Posts</a>";
  54.         if(base >= numPerPage) strBuffer = strBuffer + "<a style=\\"float:right\\" onclick=\\"setTimeout(doThings,500)\\" href=\\"#" + (base-numPerPage) + "\\">Older Posts</a> ";
  55.         strBuffer = strBuffer + "</div><br />";
  56.         strBuffer = strBuffer.replace(/<img width=.1. height=.1. [^>]+>/g, "");
  57.         container.innerHTML = strBuffer;
  58.     }
  59.     window.scroll(0,0);
  60. }
  61. function feedRead(result)
  62. {
  63.     theResult = result;
  64.     doThings();
  65. }
  66. function loadFeed() {
  67.     google = goodGoogle;
  68.     if(feedURI.substr(0,1) == "/")
  69.         feedURI = window.location.protocol + "//" + window.location.host + feedURI;
  70.     var feed = new google.feeds.Feed(feedURI);
  71.     feed.includeHistoricalEntries();
  72.     feed.setNumEntries(maxResults);
  73.     feed.load(feedRead);
  74.     // clear page title field:
  75.     var elements = document.getElementsByTagName("*");
  76.     for(var i=0 ; i<elements.length ; i++)
  77.         if(/(^| )post-title( |$)/.test(elements[i].className))
  78.             elements[i].parentNode.removeChild(elements[i]);
  79. }
  80. google.setOnLoadCallback(loadFeed);
  81. </script>
  82. <div id="feedDiv"><i>Loading, please wait...</i></div>
');