topical media & game development
mashup-delicious-09-latestlinksfooter.user.js / js
// ==UserScript==
// @name del.icio.us Latest Links Footer
// @namespace http://www.yourwebsite.com
// @description Puts the five latest del.icio.us links for the specified user at
// the bottom of every page.
// @include *
// ==/UserScript===
var delicious_username = 'username';
GM_xmlhttpRequest({
method:"GET",
url:"http://del.icio.us/feeds/json/" + delicious_username + "?count=5&raw",
headers:{
"User-Agent":"greasemonkey"
},
onload:function(details) {
var json_data = eval('('+details.responseText+')');
var div = document.createElement('div');
div.appendChild(document.createTextNode(delicious_username + "'s Latest Links"));
for (var i=0, json_data; post = json_data[i]; i++) {
div.appendChild(document.createTextNode(" - "));
var a = document.createElement('a');
a.setAttribute('href', post.u);
a.appendChild(document.createTextNode(post.d));
div.appendChild(a);
}
document.body.appendChild(div);
}
});
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.