Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.     //<![CDATA[
  3.     var postTitle = new Array();
  4.     var postUrl = new Array();
  5.     var postPublished = new Array();
  6.     var postDate = new Array();
  7.     var postLabels = new Array();
  8.     var postRecent = new Array();
  9.     var sortBy = "titleasc";
  10.     var tocLoaded = false;
  11.     var numChars = 250;
  12.     var postFilter = "";
  13.     var numberfeed = 0;
  14.     var entries = [];
  15.     var successQuery = 0;
  16.     var totalQuery = 6; //your total feeds query <script> tag
  17.  
  18. function combineEntries(a) {
  19.   if ("entry" in a.feed)
  20.     entries = [...entries,...a.feed.entry];
  21.  
  22.   successQuery++;
  23.   if (successQuery == totalQuery)
  24.     bloggersitemap();
  25. }
  26.     function bloggersitemap(a) {
  27.         function b() {
  28.             if ("entry" in a.feed) {
  29.                 var d = a.feed.entry.length;
  30.                 numberfeed = d;
  31.                 ii = 0;
  32.                 for (var h = 0; h < d; h++) {
  33.                     var n = entries[h];
  34.                     var e = n.title.$t;
  35.                     var m = n.published.$t.substring(0, 10);
  36.                     var j;
  37.                     for (var g = 0; g < n.link.length; g++) {
  38.                         if (n.link[g].rel == "alternate") {
  39.                             j = n.link[g].href;
  40.                             break
  41.                         }
  42.                     }
  43.                     var o = "";
  44.                     for (var g = 0; g < n.link.length; g++) {
  45.                         if (n.link[g].rel == "enclosure") {
  46.                             o = n.link[g].href;
  47.                             break
  48.                         }
  49.                     }
  50.                     var c = "";
  51.                     if ("category" in n) {
  52.                         for (var g = 0; g < n.category.length; g++) {
  53.                             c = n.category[g].term;
  54.                             var f = c.lastIndexOf(";");
  55.                             if (f != -1) {
  56.                                 c = c.substring(0, f)
  57.                             }
  58.                             postLabels[ii] = c;
  59.                             postTitle[ii] = e;
  60.                             postDate[ii] = m;
  61.                             postUrl[ii] = j;
  62.                             postPublished[ii] = o;
  63.                             if (h < 10) {
  64.                                 postRecent[ii] = true
  65.                             } else {
  66.                                 postRecent[ii] = false
  67.                             }
  68.                             ii = ii + 1
  69.                         }
  70.                     }
  71.                 }
  72.             }
  73.         }
  74.         b();
  75.         sortBy = "titleasc";
  76.         sortPosts(sortBy);
  77.         sortlabel();
  78.         tocLoaded = true;
  79.         displayToc2();
  80.     }
  81.  
  82.     function filterPosts(a) {
  83.         scroll(0, 0);
  84.         postFilter = a;
  85.         displayToc(postFilter)
  86.     }
  87.  
  88.     function allPosts() {
  89.         sortlabel();
  90.         postFilter = "";
  91.         displayToc(postFilter)
  92.     }
  93.  
  94.     function sortPosts(d) {
  95.         function c(e, g) {
  96.             var f = postTitle[e];
  97.             postTitle[e] = postTitle[g];
  98.             postTitle[g] = f;
  99.             var f = postDate[e];
  100.             postDate[e] = postDate[g];
  101.             postDate[g] = f;
  102.             var f = postUrl[e];
  103.             postUrl[e] = postUrl[g];
  104.             postUrl[g] = f;
  105.             var f = postLabels[e];
  106.             postLabels[e] = postLabels[g];
  107.             postLabels[g] = f;
  108.             var f = postPublished[e];
  109.             postPublished[e] = postPublished[g];
  110.             postPublished[g] = f;
  111.             var f = postRecent[e];
  112.             postRecent[e] = postRecent[g];
  113.             postRecent[g] = f
  114.         }
  115.         for (var b = 0; b < postTitle.length - 1; b++) {
  116.             for (var a = b + 1; a < postTitle.length; a++) {
  117.                 if (d == "titleasc") {
  118.                     if (postTitle[b] > postTitle[a]) {
  119.                         c(b, a)
  120.                     }
  121.                 }
  122.                 if (d == "titledesc") {
  123.                     if (postTitle[b] < postTitle[a]) {
  124.                         c(b, a)
  125.                     }
  126.                 }
  127.                 if (d == "dateoldest") {
  128.                     if (postDate[b] > postDate[a]) {
  129.                         c(b, a)
  130.                     }
  131.                 }
  132.                 if (d == "datenewest") {
  133.                     if (postDate[b] < postDate[a]) {
  134.                         c(b, a)
  135.                     }
  136.                 }
  137.                 if (d == "orderlabel") {
  138.                     if (postLabels[b] > postLabels[a]) {
  139.                         c(b, a)
  140.                     }
  141.                 }
  142.             }
  143.         }
  144.     }
  145.  
  146.     function sortlabel() {
  147.         sortBy = "orderlabel";
  148.         sortPosts(sortBy);
  149.         var a = 0;
  150.         var b = 0;
  151.         while (b < postTitle.length) {
  152.             temp1 = postLabels[b];
  153.             firsti = a;
  154.             do {
  155.                 a = a + 1
  156.             } while (postLabels[a] == temp1);
  157.             b = a;
  158.             sortPosts2(firsti, a);
  159.             if (b > postTitle.length) {
  160.                 break
  161.             }
  162.         }
  163.     }
  164.  
  165.     function sortPosts2(d, c) {
  166.         function e(f, h) {
  167.             var g = postTitle[f];
  168.             postTitle[f] = postTitle[h];
  169.             postTitle[h] = g;
  170.             var g = postDate[f];
  171.             postDate[f] = postDate[h];
  172.             postDate[h] = g;
  173.             var g = postUrl[f];
  174.             postUrl[f] = postUrl[h];
  175.             postUrl[h] = g;
  176.             var g = postLabels[f];
  177.             postLabels[f] = postLabels[h];
  178.             postLabels[h] = g;
  179.             var g = postPublished[f];
  180.             postPublished[f] = postPublished[h];
  181.             postPublished[h] = g;
  182.             var g = postRecent[f];
  183.             postRecent[f] = postRecent[h];
  184.             postRecent[h] = g
  185.         }
  186.         for (var b = d; b < c - 1; b++) {
  187.             for (var a = b + 1; a < c; a++) {
  188.                 if (postTitle[b] > postTitle[a]) {
  189.                     e(b, a)
  190.                 }
  191.             }
  192.         }
  193.     }
  194.  
  195.     function displayToc(a) {
  196.         var l = 0;
  197.         var h = "";
  198.         var e = "Post Title";
  199.         var m = "Click to sort by title";
  200.         var d = "Date";
  201.         var k = "Click to sort by date";
  202.         var c = "Category";
  203.         var j = "";
  204.         if (sortBy == "titleasc") {
  205.             m += " (descending)";
  206.             k += " (newest first)"
  207.         }
  208.         if (sortBy == "titledesc") {
  209.             m += " (ascending)";
  210.             k += " (newest first)"
  211.         }
  212.         if (sortBy == "dateoldest") {
  213.             m += " (ascending)";
  214.             k += " (newest first)"
  215.         }
  216.         if (sortBy == "datenewest") {
  217.             m += " (ascending)";
  218.             k += " (oldest first)"
  219.         }
  220.         if (postFilter != "") {
  221.             j = "Click to view all"
  222.         }
  223.         h += "<table>";
  224.         h += "<tr>";
  225.         h += '<td class="header1">';
  226.         h += '<a href="javascript:toggleTitleSort();" title="' + m + '">' + e + "</a>";
  227.         h += "</td>";
  228.         h += '<td class="header2">';
  229.         h += '<a href="javascript:toggleDateSort();" title="' + k + '">' + d + "</a>";
  230.         h += "</td>";
  231.         h += '<td class="header3">';
  232.         h += '<a href="javascript:allPosts();" title="' + j + '">' + c + "</a>";
  233.         h += "</td>";
  234.         h += '<td class="header4">';
  235.         h += "Read all";
  236.         h += "</td>";
  237.         h += "</tr>";
  238.         for (var g = 0; g < postTitle.length; g++) {
  239.             if (a == "") {
  240.                 h += '<tr><td class="entry1"><a href="' + postUrl[g] + '">' + postTitle[g] + '</a></td><td class="entry2">' + postDate[g] + '</td><td class="entry3">' + postLabels[g] + '</td><td class="entry4"><a href="' + postPublished[g] + '">Read</a></td></tr>';
  241.                 l++
  242.             } else {
  243.                 z = postLabels[g].lastIndexOf(a);
  244.                 if (z != -1) {
  245.                     h += '<tr><td class="entry1"><a href="' + postUrl[g] + '">' + postTitle[g] + '</a></td><td class="entry2">' + postDate[g] + '</td><td class="entry3">' + postLabels[g] + '</td><td class="entry4"><a href="' + postPublished[g] + '">Read</a></td></tr>';
  246.                     l++
  247.                 }
  248.             }
  249.         }
  250.         h += "</table>";
  251.         if (l == postTitle.length) {
  252.             var f = '<span class="toc-note">Show All ' + postTitle.length + " Posts<br/></span>"
  253.         } else {
  254.             var f = '<span class="toc-note">Show ' + l + " posts by category '";
  255.             f += postFilter + "' the " + postTitle.length + " Total Posts<br/></span>"
  256.         }
  257.         var b = document.getElementById("toc");
  258.         b.innerHTML = f + h
  259.     }
  260.  
  261.     function displayToc2() {
  262.         var a = 0;
  263.         var b = 0;
  264.         while (b < postTitle.length) {
  265.             temp1 = postLabels[b];
  266.             document.write("<p/>");
  267.             document.write('<p class="labels"><a href="/search/label/' + temp1 + '">' + temp1 + "</a></p><ol>");
  268.             firsti = a;
  269.             do {
  270.                 document.write("<li>");
  271.                 document.write('<a class="post-titles" href="' + postUrl[a] + '">' + postTitle[a] + "</a>");
  272.                 if (postRecent[a] == true) {
  273.                     document.write(' - <strong><span style="color: rgb(255, 0, 0);">New!</span></strong>')
  274.                 }
  275.                 document.write("</li>");
  276.                 a = a + 1
  277.             } while (postLabels[a] == temp1);
  278.             b = a;
  279.             document.write("</ol>");
  280.             sortPosts2(firsti, a);
  281.             if (b > postTitle.length) {
  282.                 break
  283.             }
  284.         }
  285.     }
  286.  
  287.     function toggleTitleSort() {
  288.         if (sortBy == "titleasc") {
  289.             sortBy = "titledesc"
  290.         } else {
  291.             sortBy = "titleasc"
  292.         }
  293.         sortPosts(sortBy);
  294.         displayToc(postFilter)
  295.     }
  296.  
  297.     function toggleDateSort() {
  298.         if (sortBy == "datenewest") {
  299.             sortBy = "dateoldest"
  300.         } else {
  301.             sortBy = "datenewest"
  302.         }
  303.         sortPosts(sortBy);
  304.         displayToc(postFilter)
  305.     }
  306.  
  307.     function showToc() {
  308.         if (tocLoaded) {
  309.             displayToc(postFilter);
  310.             var a = document.getElementById("toclink")
  311.         } else {
  312.             alert("Just wait... TOC is loading")
  313.         }
  314.     }
  315.  
  316.     function hideToc() {
  317.         var a = document.getElementById("toc");
  318.         a.innerHTML = "";
  319.         var b = document.getElementById("toclink");
  320.         b.innerHTML = '<a href="#" onclick="scroll(0,0); showToc(); Effect.toggle(\'toc-result\',\'blind\');">?? Display Table of Contents</a> <img src="http://1.bp.blogspot.com/-_VZwBpHw_SI/UrXvLbFxacI/AAAAAAAAFiQ/ZGqWZUZesCI/s1600/new_icon.gif"/>'
  321.     }
  322.  
  323.     function looptemp2() {
  324.         for (var a = 0; a < numberfeed; a++) {
  325.             document.write("<br>");
  326.             document.write('Post Link : <a href="' + postUrl[a] + '">' + postTitle[a] + "</a><br>");
  327.             document.write('Read all : <a href="' + postPublished[a] + '">' + postTitle[a] + "</a><br>");
  328.             document.write("<br>")
  329.         }
  330.     };
  331.     //]]>
  332. </script>
  333. <script src="https://blogname.blogspot.com/feeds/posts/default?start-index=1&max-results=150&amp;alt=json-in-script"></script>
  334. <script src="https://blogname.blogspot.com/feeds/posts/default?start-index=151&max-results=150&amp;alt=json-in-script"></script>
  335. <script src="https://blogname.blogspot.com/feeds/posts/default?start-index=301&max-results=150&amp;alt=json-in-script"></script>
  336. <script src="https://blogname.blogspot.com/feeds/posts/default?start-index=451&max-results=150&amp;alt=json-in-script"></script>
  337. <script src="https://blogname.blogspot.com/feeds/posts/default?start-index=601&max-results=150&amp;alt=json-in-script"></script>
  338. <script src="https://blogname.blogspot.com/feeds/posts/default?start-index=751&max-results=150&amp;alt=json-in-script"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement