Skip to content

Instantly share code, notes, and snippets.

View claudiopro's full-sized avatar
🐠

Claudio Procida claudiopro

🐠
View GitHub Profile
@claudiopro
claudiopro / poll.js
Created October 9, 2014 21:36
Poll Activity Stream notifications and print the total count (action required + unread mentions + unread notifications)
(function poll_notifications() {
var dfd = dojo.xhrGet({
url : '/connections/opensocial/basic/rest/activitystreams/@me/@actions',
handleAs : 'json'
});
dfd.addCallback(function(response, ioargs) {
var count = response.totalResults + response.connections.unreadMentions + response.connections.unreadNotifications;
console.log(count);
setTimeout(poll_notifications, 30000);
});
@claudiopro
claudiopro / Building-a-trapezoid.markdown
Created July 21, 2014 12:47
A Pen by Claudio Procida.