1. Writing Webjumps

Webjumps are created by the define_webjump function. The general form is as follows:

define_webjump(name, spec);

2. Contributed Webjumps

Share your webjumps with the Conkeror community on this page. Please keep things somewhat organized.

2.1. Bookmarks

This is a way to access bookmarks with completion via a webjump. This lets you visit bookmarks even when url_completion_use_bookmarks is false. In particular that might be so because you can't currently use both url_completion_use_bookmarks and url_completion_use_history.

define_webjump("bookmark",
               function(term) {return term;},
               $completer = history_completer($use_history = false,
                                              $use_bookmarks = true,
                                              $match_required = true),
               $description = "Visit a conkeror bookmark");

2.2. Computer Programs

2.2.1. Emacs

define_webjump("emacswiki",
    "http://www.google.com/cse?cx=004774160799092323420%3A6-ff2s0o6yi"+
        "&q=%s&sa=Search&siteurl=emacswiki.org%2F",
    $alternative="http://www.emacswiki.org/");

2.2.2. ImageMagick

// magick-options is a webjump for imagemagick command line options.
//
// magick-options caches its completions in a preference.  To clear the cache
// and force magick-options to fetch the information anew, just do:
//
//   clear_pref('conkeror.webjump.magick-options.cache');
//
// last modified: November 25, 2009
//
function magick_options_completer (input, cursor_position, conservative) {
    var completions;
    try {
        completions = get_pref('conkeror.webjump.magick-options.cache').split(' ');
    } catch (e) { }
    if (! completions) {
        try {
            var content = yield send_http_request(
                load_spec({uri: "http://www.imagemagick.org/script/command-line-options.php"}));
            completions = content.responseText
                .match(/([a-z]+)(?=\">-\1<\/a>)/g)
                .filter(remove_duplicates_filter());
            user_pref('conkeror.webjump.magick-options.cache', completions.join(' '));
        } catch (e) {
            completions = [];
        }
    }
    yield co_return(prefix_completer($completions = completions)
                    (input, cursor_position, conservative));
}
define_webjump("magick-options",
    "http://www.imagemagick.org/script/command-line-options.php#%s",
    $alternative = "http://www.imagemagick.org/script/command-line-options.php",
    $completer = magick_options_completer);

2.3. Entertainment

2.3.1. IMDb

define_webjump("imdb", "http://imdb.com/find?q=%s");

2.3.2. Internet Archive (archive.org)

define_webjump("archive.org", "http://www.archive.org/search.php?query=%s");

(ok, so arguably archive.org is about more than just entertainment - please move this if you can think of a better category)

2.3.3. last.fm

lastfm_user = "your username here";
define_webjump("lastfm", "http://www.last.fm/user/" + lastfm_user);
define_webjump("lastfm-music", "http://www.last.fm/search?m=all&q=%s");
define_webjump("lastfm-event", "http://www.last.fm/events/search?search=1&q=%s");
define_webjump("lastfm-tag", "http://www.last.fm/search?m=tag&q=%s");
define_webjump("lastfm-user", "http://www.last.fm/users?m=search&type=un&q=%s");
define_webjump("lastfm-group", "http://www.last.fm/users/groups?s_bio=%s");
define_webjump("lastfm-label", "http://www.last.fm/search?m=label&q=%s");

2.3.4. Hulu

define_webjump("hulu", "http://www.hulu.com/search?query=%s");

2.3.5. Memory-Alpha

define_webjump("memory-alpha", "http://memory-alpha.org/en/wiki/Special:Search/?search=%s");

2.3.6. Roger Ebert's Movie Reviews

define_webjump(
    "ebert",
    function (term) {
        if (! term)
            return "http://rogerebert.suntimes.com/";
        return load_spec(
            { uri: "http://rogerebert.suntimes.com/apps/pbcs.dll/classifieds?category=search3",
              post_data: make_post_data([['Class','60'], ['Type', ''],
                                         ['FromDate', '19150101'], ['ToDate', '20091231'],
                                         ['Start', '1'], ['SortOrder', 'AltTitle'],
                                         ['Genre', ''], ['GenreMultiSearch', ''],
                                         ['RatingMultiSearch', ''],['MPAASearch', ''],
                                         ['SearchType', '1'], ['qrender', ''],
                                         ['Partial',''], ['q', term]]) 
    },
    $argument = 'optional');

2.3.7. Rotten Tomatoes

define_webjump("rottentomatoes", "http://www.rottentomatoes.com/search/full_search.php?search=%s");

2.3.8. TVTropes

define_webjump("trope", "http://www.google.com/cse?cx=partner-pub-6610802604051523%3A2szln92pqym&safe=off&q=%s", $alternative="http://www.tvtropes.org");

2.3.9. Youtube

define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&search=Search");
define_webjump("youtube-user", "http://youtube.com/profile_videos?user=%s");

2.4. Finance

2.4.1. Google Finance

define_webjump("finance", "http://www.google.com/finance?q=%s");

2.5. Games

2.5.1. Anagrams

define_webjump("anagram", "http://wordsmith.org/anagram/anagram.cgi?anagram=%s&t=1000&a=n");

2.5.2. Kingdom of Loathing

define_webjump("kol", "http://kol.coldfront.net/thekolwiki/index.php/%s");

2.5.3. Sensei's Library (Go, Baduk, Weiqi)

define_webjump("sensei", "http://senseis.xmp.net/?search=%s&nrchk=1");

2.6. Index webjumps

Index webjumps provide convenient access to a set of web pages that are indexed (referenced) from another page. Two kinds are provided; xpath webjumps and gitweb summary webjumps. Completions can be provided for the webjump by saving a copy of the index page to index_webjumps_directory, which can be set as follows.

require("index-webjump.js");
index_webjumps_directory = get_home_directory();
index_webjumps_directory.appendRelativePath(".conkerorrc/index-webjumps");

For each defined index webjump the index page can be saved using M-x webjump-get-index.

2.6.1. Gitweb summary webjumps

These webjumps help you visit repositories at a gitweb server:

define_gitweb_summary_webjump("gitweb-ko", "http://git.kernel.org");
define_gitweb_summary_webjump("gitweb-cz", "http://repo.or.cz/w");

You can now use the following webjumps:

gitweb-cz conkeror
gitweb-ko git/git

To make completions available use M-x webjump-get-index and select gitweb-cz then, once the download is finished, completions will be available for that webjump. Sites with many repositories (such as the two given) can take many minutes to return the OPML data.

When defining the webjump, a default repository at the gitweb server can be specified using the $default keyword. An $alternative may otherwise be given as usual. If neither are given then the alternative url for the webjump is defined to be the gitweb repository list page.

2.6.2. XPath webjumps

An xpath webjump extracts the set of referenced web pages from an index page using an XPath expression. For these webjumps to work, the index must be downloaded using M-x webjump-get-index.

Unfortunately, the xulrunner parser that is used is quite fussy and, in particular, is an xml parser. Many web pages fail to parse correctly. To correct this problem the downloaded index page is automatically cleaned up using index_xpath_webjump_tidy_command. The html tidy program should be installed for this to work.

It can take a few attempts to figure out an appropriate XPath expression; index_webjump_try_xpath is provided to help with that process.

Examples:

define_xpath_webjump(
    "gitdoc",
    "http://www.kernel.org/pub/software/scm/git/docs/",
    '//xhtml:dt/xhtml:a',
    $description = "Git documentation");

The following examples require the html tidy program to be installed.

define_xpath_webjump(
    "conkerorwiki-page",
    "http://conkeror.org/",
    '//xhtml:li/xhtml:p/xhtml:a[starts-with(@href,"/")]',
    $description = "Conkeror wiki pages linked from the front page");

define_xpath_webjump(
    "imagemagick-options",
    "http://www.imagemagick.org/script/command-line-options.php",
    '//xhtml:p[@class="navigation-index"]/xhtml:a',
    $description = "Imagemagick command line options");

2.7. Language

2.7.1. Chinese

define_webjump("chinese", "http://www.mandarintools.com/cgi-bin/wordlook.pl?word=%s&searchtype=chinese&where=whole");
define_webjump("pinyin", "http://www.mandarintools.com/cgi-bin/wordlook.pl?word=%s&searchtype=pinyin&where=whole");
define_webjump("english", "http://www.mandarintools.com/cgi-bin/wordlook.pl?word=%s&searchtype=english&where=whole");

define_webjump("popupchinese",
    function (term) {
        return load_spec(
            { uri: "http://popupchinese.com/words/dictionary",
              post_data: make_post_data([['search', term]]) });
    },
    $alternative = "http://popupchinese.com/dictionary",
    $argument = 'optional');

define_webjump("nciku", "http://www.nciku.com/search/all/%s");

define_webjump("mdbg",
    "http://www.mdbg.net/chindict/chindict.php?page=worddictbasic&wdqb=%s&wdrst=0&wdeac=1",
    $alternative = "http://www.mdbg.net/chindict/chindict.php");

2.7.2. Esperanto

define_webjump("revo", "http://reta-vortaro.de/cgi-bin/sercxu.pl?cx=1&sercxata=%s");
define_webjump("sonja", "http://kisa.ca/vortaro/search.php?someaction=search&word=%s");

2.7.3. German

define_webjump("leo", "http://pda.leo.org/?lp=ende&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=off&spellToler=std&search=%s");

2.7.4. Japanese

define_webjump("e2j",
    function (term) {
        return load_spec(
            { uri: "http://www.freedict.com/onldict/onldict.php",
              post_data: make_post_data([['search', term], ['exact', 'true'], ['selected', '10'],
                                         ['from', 'English'], ['to', 'Japanese'],
                                         ['fname', 'eng2jap1'], ['back', 'jap.html']]) });
    },
    $alternative = "http://www.freedict.com/onldict/jap.html",
    $argument = 'optional');

define_webjump("j2e",
    function (term) {
        return load_spec(
            { uri: "http://www.freedict.com/onldict/onldict.php",
              post_data: make_post_data([['search', term], ['exact', 'true'], ['selected', '10'],
                                         ['from', 'Japanese'], ['to', 'English'],
                                         ['fname', 'eng2jap2'], ['back', 'jap.html']]) });
    },
    $alternative = "http://www.freedict.com/onldict/jap.html",
    $argument = 'optional');

2.7.5. Google Translate

define_webjump("trans", "http://translate.google.com/translate_t#auto|en|%s");

This will autodetect the source language and translate into English. Replace en with your native language if necessary. This could fairly easily be improved to take source and dest languages as parameters and autocomplete on them but it works well enough for now.

2.7.6. Urban Dictionary

define_webjump("urban", "http://www.urbandictionary.com/define.php?term=%s");

2.8. Network Tools

2.8.1. Down for everyone or just me?

define_webjump("down?", function (url) {
    if (url) {
        return "http://downforeveryoneorjustme.com/" + url;
    } else {
        return "javascript:window.location.href='http://downforeveryoneorjustme.com/'+window.location.href;";
   }
}, $argument = "optional");

2.8.2. The Wayback Machine

define_webjump("wayback", function (url) {
    if (url) {
        return "http://web.archive.org/web/*/" + url;
    } else {
        return "javascript:window.location.href='http://web.archive.org/web/*/'+window.location.href;";
    }
}, $argument = "optional");

2.9. News

2.9.1. Google News

define_webjump("news", "http://news.google.com/news/search?q=%s");

2.10. OpenSearch

2.10.1. Serchilo

Download the OpenSearch XML file from http://en.serchilo.net/?action=opensearch (possibly replacing en with your preferred locale). The example code assumes that you put it into ~/.conkerorrc.d/search-engines

let (dir = get_home_directory()) {
  dir.appendRelativePath(".conkerorrc.d/search-engines");
  load_search_engines_in_directory(dir);
  define_search_engine_webjump("serchilo-en.xml", "serchilo");
}

2.11. Programming

2.11.1. CommandLineFu

define_webjump("commandlinefu", 
    function(term) {
        return 'http://www.commandlinefu.com/commands/matching/' +
            term.replace(/[^a-zA-Z0-9_\-]/g, '')
                .replace(/[\s\-]+/g, '-') +
            '/' + btoa(term);
    },
    $argument = 'optional',
    $alternative = "http://www.commandlinefu.com/");

2.11.2. Google Codesearch

define_webjump("codesearch", "http://www.google.com/codesearch?q=%s");

2.11.3. Mozilla Developer Center

define_webjump("mdc", "https://developer.mozilla.org/Special:Search?search=%s&type=fulltext&go=Search");

2.11.4. Perl

define_webjump("perldoc", "http://perldoc.perl.org/search.html?q=%s");
define_webjump("cpan", "http://search.cpan.org/search?query=%s&mode=all");

2.11.5. Qt

define_webjump("qt", "http://doc.qtsoftware.com/4.5/%s.html");

Not actually a search engine, but it's good enough to look up classes by name.

2.11.6. Scheme

2.11.6.1. Chickadee

function chickadee_completer (input, cursor_position, conservative) {
    var completions = [];
    var content = yield send_http_request(
        load_spec({uri: "http://3e8.org/cdoc/ajax/prefix?q="+
                   encodeURIComponent(input)}));
    if (content.responseText) {
        var parser = Cc["@mozilla.org/xmlextras/domparser;1"]  
            .createInstance(Ci.nsIDOMParser);  
        var doc = parser.parseFromString(content.responseText, "text/xml");
        var res = doc.getElementsByTagName("li")
        for (let i = 0, n = res.length; i < n; ++i) {
            completions.push(res[i].textContent);
        }
    }
    yield co_return(prefix_completer($completions = completions)
                    (input, cursor_position, conservative));
}
define_webjump("chickadee",
    "http://3e8.org/cdoc?q=%s&query-name=Lookup",
    $alternative = "http://3e8.org/chickadee/",
    $completer = chickadee_completer);

2.11.7. TeX

define_webjump("ctan-desc", "http://www.ctan.org/cgi-bin/search.py?"+
               "metadataSearch=%s&metadataSearchSubmit=Search");
define_webjump("ctan-pack", "http://www.ctan.org/cgi-bin/search.py?"+
               "tdsFilename=%s&tdsFilenameSearch=Search");
define_webjump("ctan-file", "http://www.ctan.org/cgi-bin/filenameSearch.py?"+
               "filename=%s&Search=Search");
define_webjump("ctan-doc", "http://www.ctan.org/cgi-bin/searchFullText.py?"+
               "fullTextSearch=%s&fullTextSearchSubmit=Search");

2.11.8. Haskell

define_webjump("hoogle", "http://haskell.org/hoogle/?hoogle=%s",
               $alternative = "http://haskell.org/hoogle/");

2.12. Reference

2.12.1. Encyclopedia of Life

define_webjump("eol", "http://eol.org/search?q=%s&ie=UTF-8&search_type=text");

2.12.2. Wikipedia

The Wikipedia webjumps are now included with Conkeror. Put the following in your .conkerorrc to use it:

require("page-modes/wikipedia.js");
wikipedia_webjumps_format = "wp-%s"; // controls the names of the webjumps.  default is "wikipedia-%s".
define_wikipedia_webjumps("en", "de", "fr"); // For English, German and French.
// define_wikipedia_webjumps(); // To make use of ALL of the webjumps (200+).

Some people like having to only type the language code to get to a Wikipedia, in that case you can just set the format to "%s". This means you can write only "en bruce springsteen" to get to the article about Bruce Springsteen on the English Wikipedia.

2.12.3. Wolfram Alpha

define_webjump("alpha", "http://www36.wolframalpha.com/input/?i=%s");

2.13. Search Engines

2.13.1. Cuil

define_webjump("cuil", "http://www.cuil.com/search?q=%s");

2.13.2. Duck Duck Go

define_webjump("duckduckgo", "http://duckduckgo.com/?q=%s");

2.13.3. IxQuick

define_webjump("ixquick", "http://ixquick.com/do/metasearch.pl?query=%s");

2.13.4. SoGou

define_webjump("sogou", "http://www.sogou.com/web?query=%s");

2.13.5. Scroogle

define_webjump("scroogle", "http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=%s");
define_webjump("scrooglessl", "https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=%s");

2.14. Shopping

define_webjump("netflix", "http://www.netflix.com/Search?v1=%s");
define_webjump("amazon", "http://www.amazon.com/exec/obidos/external-search/?field-keywords=%s&mode=blended");
define_webjump("emusic", "http://www.emusic.com/search.html?mode=x&QT=%s");

2.15. Software

2.15.1. Debian package searches

These are included (in a slightly modified version) by default in the Debian and Ubuntu packages starting with version 0.9.1-1:

define_webjump("deb", "http://packages.debian.org/search?keywords=%s&searchon=names&suite=unstable&section=all");
define_webjump("debfile", "http://packages.debian.org/search?searchon=contents&keywords=%s&mode=path&suite=unstable&arch=any");
define_webjump("debbugs", "http://bugs.debian.org/%s");
define_webjump("debpts", "http://packages.qa.debian.org/%s");

Not yet included in the Debian and Ubuntu packages are the following Debian webjumps:

define_webjump("buildd", "https://buildd.debian.org/%s");
define_webjump("buildd-experimental", "http://experimental.ftbfs.de/%s");
define_webjump("buildd-ports", "http://buildd.debian-ports.org/build.php?pkg=%s");
define_webjump("debqa", "http://qa.debian.org/developer.php?login=%s");

Adjust suite, arch etc to suit.

2.15.2. Ubuntu / Launchpad package searches

These are included by default in the Debian and Ubuntu packages starting with version 0.9.1-1:

define_webjump("ubuntupkg", "http://packages.ubuntu.com/%s");
define_webjump("ubuntufile", "http://packages.ubuntu.com/search?searchon=contents&keywords=%s&mode=path&arch=any");
define_webjump("ubuntubugs", "http://bugs.launchpad.net/ubuntu/+source/%s");
define_webjump("launchpad", "https://launchpad.net/+search?field.text=%s");

2.15.3. Github search

define_webjump("github", "http://github.com/search?q=%s&type=Everything");

2.15.4. Gitorious search

define_webjump("gitorious", "http://gitorious.org/search?q=%s");

2.15.5. Ohloh project search

define_webjump("ohloh", "https://www.ohloh.net/p?query=%s");

2.15.6. Savannah project search

define_webjump("savannah", "https://savannah.gnu.org/search/?words=%s&type_of_search=soft");

2.16. Sports

2.16.1. Bicycling

define_webjump("sheldonbrown",
               "http://www.google.com/search?q=site:sheldonbrown.com %s",
               $alternative = "http://sheldonbrown.com/");

2.17. Travel

2.17.1. Wikitravel

define_webjump("wikitravel", "http://wikitravel.org/en/Special:Search/?search=%s");

2.18. Weather

2.18.1. Weather Underground

define_webjump("weather", "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=%s");

Webjumps (last edited 2010-08-20 09:25:58 by XTaran)