Basic - Recent Posts with Label

We can pull the post's first label with entry.category[0].term;. There is no need to get more labels for recent posts. But if we don't add any label on the posts, probably it won't work regularly. The ternary operator has been used to manipulate this problem.
<script>
var numposts = 4;
var isList = true;

function showrecentposts(json) {
    for (var i = 0; i < 4; i++) {
        var entry = json.feed.entry[i];
        var postTitle = entry.title.$t;
        var postLabel = entry.category ? entry.category[0].term : "No label";
        
        var postUrl;
        if (i == json.feed.entry.length) break;
        for (var k = 0; k < entry.link.length; k++) {
            if (entry.link[k].rel == "alternate") {
                postUrl = entry.link[k].href;
                break;
            }
        }
        postTitle = postTitle.link(postUrl);
        if (isList) document.write("<li>");
        document.write(postTitle + postLabel);
    }
    if (isList) document.write("</li>");
}
</script>

<ul>
<script src="//btdocumentation.blogspot.com/feeds/posts/default?max-results=900&amp;alt=json-in-script&amp;callback=showrecentposts">
</script>
</ul>

Read more »

Basic - Recent Posts with Summary

Unlike others, summary is used as feed parameter instead of default. Because entry.summary.$t cannot work if there isn't jump-break in post and it will show all post content. There is other problem about this. Probably it's about html tags, An unbalanced tree was written using document.write() causing data from the network to be reparsed for firefox 4+ Maybe we can solve this problem with a function like removeHTMLtag.
<script>
var numposts = 4;
var isList = true;

function removeHtmlTag(summary,len_summary){
    if(summary.indexOf("<")!=-1)
    {
        var s = summary.split("<");
        for(var i=0;i<s.length;i++){
            if(s[i].indexOf(">")!=-1){
                s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
            }
        }
        summary = s.join("");
    }
    len_summary = (len_summary < summary.length-1) ? len_summary : summary.length-2;
    while(summary.charAt(len_summary-1)!=' ' && summary.indexOf(' ',len_summary)!=-1) len_summary++;
    summary = summary.substring(0,len_summary-1);
    return summary+'...';
}

function showrecentposts(json) {
    for (var i = 0; i < 4; i++) {
        var entry = json.feed.entry[i];
        var postTitle = entry.title.$t;
        var postSummary = entry.summary.$t;
        
        postSummary = removeHtmlTag(postSummary, 300);
        
        var postUrl;
        
        if (i == json.feed.entry.length) break;
        for (var k = 0; k < entry.link.length; k++) {
            if (entry.link[k].rel == "alternate") {
                postUrl = entry.link[k].href;
                break;
            }
        }
        postTitle = postTitle.link(postUrl);
        if (isList) document.write("<li>");
        document.write(postTitle + postSummary);
    }
    if (isList) document.write("</li>");
}

</script>

<ul>
<script src="//btdocumentation.blogspot.com/feeds/posts/summary?max-results=900&amp;alt=json-in-script&amp;callback=showrecentposts">
</script>
</ul>

Read more »

Basic - Recent Posts with Thumbnails

To get the thumbnail, we can use entry.media$thumbnail. However, this isn't enough for it to working without errors. Some posts may not contain images. This situation will lead to an error. entry.content.$ is available to solve the problem. This gives content with html. In this the content variable, we can search image's url value using regular expression. If there is no image then we use default thumbnail image. But if there is image then we can use entry.media$thumbnail.
<script>
var numposts = 4;
var isList = true;

function showrecentposts(json) {
    for (var i = 0; i < 4; i++) {
        var entry = json.feed.entry[i];
        var postTitle = entry.title.$t;
        var postContent = entry.content.$;

        var regex = /<img.*?>/;
        var thumbnailURL = regex.exec(postContent);
        
        var defaultThumbnail = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP4DbxZnqDqEYlzaFHjeChRA_Qd7aulYeSapH8Xf6wdPK5Zx4vieNZ5FpE2tqfb_0RCDuUYYTNed0UVAf4xE3wY_fMvBLfJ7hEIYRg9V8mzoxqt5ZAQBo6vxmoGdaPfs5bUJsF19dGb983/s1600/default-thumbnail.png";
        
        if(thumbnailURL == null) var thumbnailURL = defaultThumbnail;
        else{
            var thumbnailURL = entry.media$thumbnail.url;
        }
        
        var postUrl;
        if (i == json.feed.entry.length) break;
        for (var k = 0; k < entry.link.length; k++) {
        if (entry.link[k].rel == "alternate") {
            postUrl = entry.link[k].href;
            break;
        }
        }
        postTitle = postTitle.link(postUrl);
        if (isList) document.write("<li>");
        document.write("<img src=" + thumbnailURL +"></img>" + postTitle);
    }
    if (isList) document.write("</li>");
}
</script>

<ul>
<script src="//btdocumentation.blogspot.com/feeds/posts/default?max-results=900&amp;alt=json-in-script&amp;callback=showrecentposts">
</script>
</ul>
Read more »

Basic - Recent Posts

[Yellow Field] Domain name should be changed.
<script>
    var numposts = 4;
    var isList = true;
    function showrecentposts(json) {
      for (var i = 0; i < 4; i++) {
        var entry = json.feed.entry[i];
        var postTitle = entry.title.$t;
        var postUrl;
        if (i == json.feed.entry.length) break;
        for (var k = 0; k < entry.link.length; k++) {
          if (entry.link[k].rel == "alternate") {
            postUrl = entry.link[k].href;
            break;
          }}
        postTitle = postTitle.link(postUrl);
        if (isList) document.write("<li>");
        document.write(postTitle);}
        if (isList) document.write("</li>");
    }
    </script>

<br />
<ul>
    <script src="//btdocumentation.blogspot.com/feeds/posts/default?max-results=900&amp;alt=json-in-script&amp;callback=showrecentposts">
</script>
    </ul>

Read more »