<!DOCTYPE html>
<html lang="en-US">
<head>
<!--
.
.
.
insert this inline Javascript just prior to the closing </head> tag -->
<script>
// -- DEBUG flag
var DEBUG=0;
// -- tumblrBlogID must be pulled from Tumblr v1 API response --
var tumblrBlogId='-Izlb05y3xIcoKetU2_NHA';
// ------------------------------------------------------------
function embedTumblrPosts(loc, limit, tag2ignore) {
if (!tumblr_api_read) {
console.log("tumblr_api_read json data block is empty!");
return;
}
var response = tumblr_api_read.posts;
var len = response.length;
var block = document.getElementById(loc);
var embedApiHref = "https://embed.tumblr.com/embed/post/"+tumblrBlogId+"/";
var post;
var recent;
var html;
for (var i = 0; i < len; ++i) {
post = response[i];
if(DEBUG){
console.log("id="+post['id']);console.log('url-slug: '+post['url-with-slug']);
console.log("i="+i+" len="+len+" limit="+limit);
}
if(typeof post['tags'] !== 'undefined') {
if(DEBUG){console.log('post tag array:'+post['tags']);}
if(post['tags'].includes('hidden')) {
if(DEBUG){console.log('--Post Flagged to be hidden!');}
++limit;continue;
}
if(typeof tag2ignore !== 'undefined' && post['tags'].includes(tag2ignore)) {
if(DEBUG){console.log('--Post Flagged to be ignored! '+tag2ignore);}
++limit;continue;
}
}
dataHref = embedApiHref + post['id'];
recent = document.createElement('div');
recent.setAttribute("class", "tumblr-post");
recent.setAttribute("data-href", dataHref);
html = "<noscript><li><a href='" +
(post['url-with-slug'] || post.url) + "'>" +
(post['url-with-slug'] || post.url) + "</a></noscript>";
recent.innerHTML = html;
block.appendChild(recent);
}
};
</script>
</head>
<body>
<!--
.
.
.
insert this 'Featured Post' HTML widget on a desirable place...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.