Google+
Code:
SocialDig({
selector: '.google-plus',
service: 'google-plus',
user: '102950045493550983271',
auth: 'xxxxx'
}, function(data) {
if (data.items.length > 0) {
var list = document.createElement('div');
list.className = 'g g-s-2 posts';
// Loop through the posts
data.items.forEach(function(el, idx, arr) {
if (idx < 4) {
var item = document.createElement('div');
item.className = 'gi post';
item.innerHTML = '<div class="g-post" data-href="' + el.url + '"></div>';
// Add the new item to the list
list.appendChild(item);
}
});
// Add the list to the page
document.querySelector('.google-plus').appendChild(list);
// Add the embed script
var plusScript = document.createElement('script');
plusScript.src = 'https://apis.google.com/js/platform.js';
plusScript.async = true;
document.getElementsByTagName('body')[0].appendChild(plusScript);
}
});