Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
firefox tomblooのパッチ。deliciousのポストURLの変更に対応。あとアイコン。
Delicious.ICON="http://delicious.com/img/favicon.ico";
addAround(Delicious, 'post', function(proceed, args, self) {
var ps = args[0] = update({}, args[0]);
return self.getCurrentUser().addCallback(function(){
return request('http://previous.delicious.com/save', {
queryString : {
title : ps.item,
url : ps.itemUrl,
}
})
}).addCallback(function(res){
var doc = convertToHTMLDocument(res.responseText);
var form = {};
items(formContents(doc.documentElement)).forEach(function([key, value]){
form[key.replace(/[A-Z]/g, function(c){
return '_' + c.toLowerCase()
})] = value;
});
return request('http://previous.delicious.com/save', {
sendContent : update(form, {
title : ps.item,
url : ps.itemUrl,
note : joinText([ps.body, ps.description], ' ', true),
tags : joinText(ps.tags, ','),
private : ps.private,
}),
});
}).addCallback(function(res){
res = JSON.parse(res.responseText);
if(res.error)
throw new Error(res.error_msg);
});
});
addAround(Delicious, 'getInfo', function(proceed, args, self) {
return request('http://previous.delicious.com/save/quick', {method : 'POST'}).addCallback(function(res){
return evalInSandbox('(' + res.responseText + ')', 'http://previous.delicious.com/');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment