Created
June 24, 2014 08:26
-
-
Save petitviolet/cd669a6952a2116c558e to your computer and use it in GitHub Desktop.
hatena bookmark search command at vimperator
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
(function() { | |
// change to your hatena user name!!! | |
var HATENA_USERNAME = 'petitviolet'; | |
liberator.modules.commands.addUserCommand( | |
["hatena[bookmark]", "hb"], | |
"search from my hatena bookmarks", | |
function(args){ | |
if (args.length === 0) { | |
liberator.echo('input a query!'); | |
return false; | |
} | |
// make "and" query | |
var query = args.join("+"); | |
var hatenaUrl = 'http://b.hatena.ne.jp/' + HATENA_USERNAME + '/search?q='; | |
// open in a new tab | |
liberator.open(hatenaUrl + query, liberator.NEW_TAB); | |
return false; | |
}, | |
{}, | |
true | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment