Pentadactyl: command to search BTDIGG.org

2.2k views Asked by At

I'd like to add a pentadactyl (it's a fork of vimperator) command to search btdigg torrent search engine. The query structure is shown in the example below - where "test with space" is searched:

http://btdigg.org/search?q=test+with+space

I tried to execute:

:command -nargs=* btdigg open http://btdigg.org/search?q= <args>

It brings me to the title page what ever I give it. So it doesn't work. Can You fix it? I want to the following command

:btdigg arg1 arg2 arg3

to search "arg1 arg2 arg3" string in www.btdigg.org

Edit:

So here's my best try. It's a javascript code to search a given site(s). If I could make it work - the problem with btdigg will also be solved:

javascript <<EOF
    dactyl.searchWikis = function (selection) {
        let parsedSelection = selection.replace(/^\s*/, "" ).replace(/\s*$/, "" ).replace(/\s+/g, "+" );
        dactyl.execute( ":tabopen http://www.scholarpedia.org/wiki/index.php?title=Special:Search&search=" + selection);
        dactyl.execute( ":tabopen http://en.citizendium.org/wiki?title=Special:Search&search=" + selection);
    };
EOF

:command  bookSearch -nargs=* -js dactyl.searchWikis(<args>)

But PentaDactyl doesn't see it. Can You please make Pentadactyl see it?

2

There are 2 answers

0
Adobe On BEST ANSWER

Get the add-to-search-bar addon, then right-click on the btdigg's search bar and choose "Add to search bar". Say You'll name it btdigg, After that:

:btdigg arg1 arg2 arg3

would search "arg1 arg2 arg3" in btdigg.

0
debil On

Another option is to use an external site: http://yubnub.org/. It even has the related command ready: http://yubnub.org/kernel/man?args=btdigg. Basically you install the YubNub search plugin from http://mycroftproject.com/search-engines.html?name=yubnub (pick up the Mirror) and set the default search engine in your ~/.pentadactylrc to match it.