Last active
November 28, 2018 06:08
Star
You must be signed in to star a gist
patch.fix.hatena.addbookmark.tbrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==Taberareloo== | |
// { | |
// "name" : "Fix Hatena.addBookmark 2018.11" | |
// , "description" : "Fix Hatena.addBookmark 2018.11" | |
// , "include" : ["background"] | |
// , "version" : "0.0.1" | |
// , "downloadURL" : "https://gist.githubusercontent.com/animist/d9e11ad8fc2922cde66fd5118141593e/raw/4efa6ad9c6f06e483fc08c9fe97c0674cd0066a1/patch.fix.hatena.addbookmark.tbrl.js" | |
// } | |
// ==/Taberareloo== | |
(function() { | |
addAround(HatenaBookmark, 'addBookmark', function (proceed, args, target, methodName) { | |
var self = target; | |
var url = args[0]; | |
var title = args[1]; | |
var tags = args[2]; | |
var description = args[3]; | |
return HatenaBlog.getUserName().then(function(userName) { | |
return self.getToken().then(function (data) { | |
return request('http://b.hatena.ne.jp/' + userName + '/add.edit.json', { | |
//denyRedirection: true, | |
method: 'POST', | |
sendContent : { | |
rks : data['rks'], | |
url : url.replace(/%[0-9a-f]{2}/g, function (s) { | |
return s.toUpperCase(); | |
}), | |
title : title, | |
comment : Hatena.reprTags(tags) + description.replace(/[\n\r]+/g, ' ') | |
} | |
}); | |
}); | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment