View more demos...

Instagram


Code:

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

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

                var caption = '';
                if (el.caption) {
                    caption = '<br>' + el.caption.text;
                }

                item.innerHTML = '<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="7" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;"> <div style=" background:url(' + el.images.standard_resolution.url + '); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div></div> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="' + el.link + '" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">' + caption + '</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">A photo posted by ' + el.user.full_name + ' (@' + el.user.username + ').</p></div></blockquote>';

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

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

        // Add the embed script
        var instaScript = document.createElement('script');
        instaScript.src = '//platform.instagram.com/en_US/embeds.js';
        instaScript.async = true;
        instaScript.defer = true;
        document.getElementsByTagName('body')[0].appendChild(instaScript);
    }
});

Results: