Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.javascript > #8216

script che dovrebbe estrarre tutti i post in blogger, ma non lo fa

Newsgroups it.comp.lang.javascript
Date 2017-07-03 13:45 -0700
Message-ID <c93cd9a3-b945-4f76-9897-9d5e184c8a2c@googlegroups.com> (permalink)
Subject script che dovrebbe estrarre tutti i post in blogger, ma non lo fa
From Valter Bruno <ik1qew@gmail.com>

Show all headers | View raw


Nel mio blog (nella piattaforma di blogger) sto utilizzando uno script che dovrebbe estrarre tutti i post con le relative "etichette" o "tag".
Il risultato è rappresentato a questo link https://goo.gl/w3pzWN
Funziona bene ma le informazioni estratte non sono complete.
Lo script non prende tutti i post, sembra che arrivi sino a 150 su 212 e non riesco a trovare l'informazione da cambiare per fargli fare il lavoro completo.
Se qualcuno può darmi una mano lo ringrazio già in anticipo
grazie ancora, Valter Bruno

- - - inizio

<script type="text/javascript">
/* Questo è un commento sulla prima riga, che non compare
   Questo è un javascript che visualizza titolo del post + etichette (sino a "max-results=999 in origine era =8)
   https://stackoverflow.com/questions/38242945/blogger-show-all-labels-of-a-post-using-javascript
   Questa è l'ultima riga del commento */

function LoadDetails(TotalFeed) {
 var PostTitles = new Array();
 var PostURLs = new Array();
 var PostLabels=new Array();
 var d="";
 if ("entry" in TotalFeed.feed) {
 var PostEntries = TotalFeed.feed.entry.length;
 for (var PostNum = 0; PostNum < PostEntries; PostNum++) {
  var ThisPost = TotalFeed.feed.entry[PostNum];
  PostTitles.push(ThisPost.title.$t);
  d="";
 if("category"in TotalFeed.feed.entry[PostNum])
 {
 for(var b=0;b<TotalFeed.feed.entry[PostNum].category.length;b++)
  d+='<a href="/search/label/'+TotalFeed.feed.entry[PostNum].category[b].term+'?max-results=999">'+TotalFeed.feed.entry[PostNum].category[b].term+"</a> \u002C "; 
  b=d.lastIndexOf(" \u002C ");-1!=b&&(d=d.substring(0,b))
 }
  
  var ThisPostURL;
  for (var LinkNum = 0; LinkNum < ThisPost.link.length; LinkNum++) {
   if (ThisPost.link[LinkNum].rel == "alternate") {
   ThisPostURL = ThisPost.link[LinkNum].href;
   break;
   }
  }
  PostURLs.push(ThisPostURL);
  PostLabels.push(d);
 }
 }
 DisplayPosts(PostTitles, PostURLs, PostLabels);
}

function DisplayPosts(PostTitles, PostURLs, PostLabels) {
 var NumberOfEntries = PostTitles.length;
 document.write('<ul class="blogger-archive">');
 for (var EntryNum = 0; EntryNum < NumberOfEntries; EntryNum++) {
  document.write('<li><a href ="' + PostURLs[EntryNum] + '">' + PostTitles[EntryNum] + "</a> | <span>"+PostLabels[EntryNum]+"</span></li>");
 }
document.write('</ul>');
}
</script>

<script type="text/javascript" src="/feeds/posts/default?max-results=500&alt=json-in-script&callback=LoadDetails"></script>

- - - fine

Back to it.comp.lang.javascript | Previous | Next | Find similar


Thread

script che dovrebbe estrarre tutti i post in blogger, ma non lo fa Valter Bruno <ik1qew@gmail.com> - 2017-07-03 13:45 -0700

csiph-web