View more demos...

Flickr


Code:

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


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

                item.innerHTML = '<a href="http://www.flickr.com/photos/' + el.owner + '/' + el.id + '" target="_blank"><img src="http://www.flickr.com/photos/' + el.id + '_' + el.secret + '.jpg"><br>' + el.title + '</a>';

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

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

Results: