Ahmad_Afzaal

ToolsByJenny Archieve

Feb 12th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. <script type="text/javascript">
  2. function LoadTheArchive(TotalFeed)
  3. {
  4. var PostTitles = new Array();
  5. var PostURLs = new Array();
  6. var PostYears = new Array();
  7. var PostMonths = new Array();
  8. var PostDays = new Array();
  9. if("entry" in TotalFeed.feed)
  10. {
  11. var PostEntries=TotalFeed.feed.entry.length;
  12. for(var PostNum=0; PostNum<PostEntries ; PostNum++)
  13. {
  14. var ThisPost = TotalFeed.feed.entry[PostNum];
  15. PostTitles.push(ThisPost.title.$t);
  16. PostYears.push(ThisPost.published.$t.substring(0,4));
  17. PostMonths.push(ThisPost.published.$t.substring(5,7));
  18. PostDays.push(ThisPost.published.$t.substring(8,10));
  19. var ThisPostURL;
  20. for(var LinkNum=0; LinkNum < ThisPost.link.length; LinkNum++)
  21. {
  22. if(ThisPost.link[LinkNum].rel == "alternate")
  23. {
  24. ThisPostURL = ThisPost.link[LinkNum].href;
  25. break
  26. }
  27. }
  28. PostURLs.push(ThisPostURL);
  29. }
  30. }
  31. DisplaytheTOC(PostTitles,PostURLs,PostYears,PostMonths,PostDays);
  32. }
  33.  
  34. function DisplaytheTOC(PostTitles,PostURLs,PostYears,PostMonths,PostDays)
  35. {
  36. var MonthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];
  37. var NumberOfEntries=PostTitles.length;
  38.  
  39. var currentMonth = "";
  40. var currentYear = "";
  41.  
  42. for(var EntryNum = 0; EntryNum < NumberOfEntries; EntryNum++)
  43. {
  44. NameOfMonth = MonthNames[parseInt(PostMonths[EntryNum],10)-1]
  45.  
  46. if (currentMonth != NameOfMonth || currentYear != PostYears[EntryNum]) {
  47. currentMonth = NameOfMonth;
  48. currentYear = PostYears[EntryNum];
  49.  
  50. document.write("<div class='dateStyle'><br />" + currentMonth+" "+currentYear+" </div>");
  51. }
  52.  
  53. document.write('<a href ="'+PostURLs[EntryNum]+'"><div class=dayStyle>'+parseInt(PostDays[EntryNum],10)+":&nbsp;&nbsp;</div> "+PostTitles[EntryNum]+"</a><br />");
  54. }
  55. }
  56. </script>
  57.  
  58. <script src="http://www.ToolsByJenny.blogspot.com/feeds/posts/default?max-results=500&amp;alt=json-in-script&amp;callback=LoadTheArchive" />
  59. </script>
  60.  
  61. <!--CUSTOMIZATION-->
  62. <style type="text/css">
  63. .dateStyle {
  64. color:#000;
  65. font-weight:bold;
  66. font-size: 15px;
  67. font-family: Arial, sans-serif;
  68. margin: 0;
  69. }
  70.  
  71. .dayStyle {
  72. color:#000;
  73. font-weight:bold;
  74. font-family: Arial, sans-serif;
  75. display: inline-block;
  76. }
  77.  
  78. </style>
Add Comment
Please, Sign In to add comment