500px
Code:
SocialDig({
selector: '.fivehundredpx',
service: '500px',
user: 'kjbrum',
auth: 'xxxxx'
}, function(data) {
if (data.photos.length > 0) {
var list = document.createElement('div');
list.className = 'g g-s-2 photos';
// Loop through the photos
data.photos.forEach(function(el, idx, arr) {
if (idx < 4) {
var item = document.createElement('div');
item.className = 'gi photo';
item.innerHTML = '<a href="http://500px.com' + el.url + '" target="_blank"><img src="' + el.image_url + '" alt="' + el.name + '" title="' + el.name + '"><br>' + el.name + '</a>';
// Add the new item to the list
list.appendChild(item);
}
});
// Add the list to the page
document.querySelector('.fivehundredpx').appendChild(list);
}
});