View more demos...

Tumblr


Code:

SocialDig({
    selector: '.tumblr',
    service: 'tumblr',
    user: 'kjbrum',
    auth: 'xxxxx'
}, function(data) {
    if (data.response.posts.length > 0) {
        var list = document.createElement('div');
        list.className = 'g g-s-2 posts';

        // Loop through the pins
        data.response.posts.forEach(function(el, idx, arr) {
            if (idx < 4) {
                var item = document.createElement('div');
                item.className = 'gi post';

                item.innerHTML = '<div class="tumblr-post" data-href="https://embed.tumblr.com/embed/post/XZ0xuZ47P9PQARLUbgwSSA/' + el.id + '"><a href="' + el.post_url + '">' + el.post_url + '</a></div>';

                // Add the new item to the list
                list.appendChild(item);
            }
        });

        // Add the list to the page
        document.querySelector('.tumblr').appendChild(list);

        // Add the embed script
        var tumblrScript = document.createElement('script');
        tumblrScript.src = 'https://secure.assets.tumblr.com/post.js';
        tumblrScript.async = true;
        document.getElementsByTagName('body')[0].appendChild(tumblrScript);
    }
});

Results: