NAME

hooks.pl -- Perl hooks for the ELinks text WWW browser

DESCRIPTION

This file contains the Perl hooks for the ELinks text WWW browser.

These hooks change the browser's behavior in various ways. They allow shortcuts to be used in the Goto URL dialog, modifying the source of a page, proxy handling, and other things such as displaying a fortune at exit.

CONFIGURATION FILE

This hooks file reads its configuration from ~/.elinks/config.pl. The following is an example of the configuration file:

        bork:       yep       # BORKify Google?
        collapse:   okay      # Collapse all XBEL bookmark folders on exit?
        email:                # Set to show one's own bugs with the "bug" prefix.
        external:   wget      # Send the current URL to this application.
        fortune:    elinks    # *fortune*, *elinks* tip, or *none* on quit?
        googlebeta: hell no   # I miss DejaNews...
        gotosearch: why not   # Anything not a URL in the Goto URL dialog...
        ipv6:       sure      # IPV4 or 6 address blocks with "ip" prefix?
        language:   english   # "bf nl en" still works, but now "bf nl" does too
        news:       msnbc     # Agency to use for "news" and "n" prefixes
        search:     elgoog    # Engine for (search|find|www|web|s|f|go) prefixes
        usenet:     google    # *google* or *standard* view for news:// URLs
        weather:    cnn       # Server for "weather" and "w" prefixes

        # news:    bbc, msnbc, cnn, fox, google, yahoo, reuters, eff, wired,
        #          slashdot, newsforge, usnews, newsci, discover, sciam
        # search:  elgoog, google, yahoo, ask jeeves, a9, altavista, msn, dmoz,
        #          dogpile, mamma, webcrawler, netscape, lycos, hotbot, excite
        # weather: weather underground, google, yahoo, cnn, accuweather,
        #          ask jeeves

Developer's usage: The function loadrc() takes a preference name as its single argument and returns either an empty string if it is not specified, yes for a true value (even if specified like sure or why not), no for a false value (even if like nah, off or 0), or the lowercased preference value (like cnn for weather: CNN).

GOTO URL HOOK

This is a summary of the shortcuts defined in this file for use in the Goto URL dialog. They are similar to the builtin URL prefixes, but more flexible and powerful.

News agencies:
British Broadcasting Corporation: bbc (default)
MSNBC: msnbc
Cable News Network: cnn
FOXNews: fox
Google News: gn
Yahoo News: yn
Reuters: rs or reuters
Electronic Frontier Foundation: eff
Wired: wd or wired
Slashdot: /. or sd or slashdot
NewsForge: nf or newsforge
U.S.News & World Report: us or usnews
New Scientist: newsci or nsci
Discover Magazine: dm
Scientific American: sa or sciam

default agency: n, news

Locators:
Internet Movie Database: imdb, movie, or flick
US zip code search: zip or usps (# or address)
IP address locator / address space: ip
WHOIS / TLD list: whois (current url or specified)
Weather: w or weather
Yahoo! Finance / NASD Regulation: stock, ticker, or quote
Snopes: ul, urban, or legend
Torrent search / ISOHunt: bt, torrent, or bittorrent
Wayback Machine: ia, ar, arc, or archive (current url or specified)
Freshmeat: fm or freshmeat
SourceForge: sf or sourceforge
Savannah: sv or savannah
Gna!: gna
BerliOS: bl or berlios
Netcraft Uptime Survey: whatis or uptime (current url or specified)
Who's Alive and Who's Dead: Wanted, dead or alive!
Google Library / Project Gutenberg: book or read
Internet Public Library: ipl
Urban Dictionary: urbandict or ud <word>
Google Groups:

deja, gg, groups, gr, nntp, usenet, nn

MirrorDot:

md or mirrordot <URL>

Coral cache:

cc, coral, or nyud <URL>

AltaVista Babelfish:

babelfish, babel, bf, translate, trans, or b <from> <to>

"babelfish german english" or "bf de en"

W3C page validators:

vhtml or vcss <URL> (or current url)

Bugzilla: bz or bug (# or search optional)
Documentation and FAQ: doc(|s|umentation) or faq

There's no place like home...

The Dialectizer:

dia <dialect> <URL> (or current url)

Dialects: redneck, jive, cockney, fudd, bork, moron, piglatin, or hacker

Sender:

send

Dictionary:

dict, d, def, or define <word>

ss <domain> <string>

Anything not a prefix, URL, or local file will be treated as a search using the search engine defined by the 'search' configuration option if 'gotosearch' is set to some variation of 'yes'.

FOLLOW URL HOOK

These hooks effect a URL before ELinks has a chance to load it.

PRE FORMAT HTML HOOK

When an HTML document is downloaded and is about to undergo the final rendering, this hook is called. This is frequently used to get rid of ads, but also various ELinks-unfriendly HTML code and HTML snippets which are irrelevant to ELinks but can obfuscate the rendered document.

Note that these hooks are applied only before the final rendering, not before the gradual re-renderings which happen when only part of the document is available.

PROXY FOR HOOK

The Perl hooks are asked whether to use a proxy for a given URL (or what proxy to actually use). You can use it if you don't want to use a proxy for certain Intranet servers but you need to use it in order to get to the Internet, or if you want to use some anonymizer for access to certain sites.

QUIT HOOK

The Perl hooks can also perform various actions when ELinks quits. These can be things like retouching the just saved "information files", or doing some fun stuff.

SEE ALSO

elinks(1), perl(1)

AUTHORS

Russ Rowan, Petr Baudis

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 101:

You can't have =items (as at line 127) unless the first thing after the =over is an =item

Around line 1078:

You can't have =items (as at line 1091) unless the first thing after the =over is an =item

Around line 1148:

You can't have =items (as at line 1164) unless the first thing after the =over is an =item

Around line 1253:

You can't have =items (as at line 1267) unless the first thing after the =over is an =item

Around line 1291:

You can't have =items (as at line 1304) unless the first thing after the =over is an =item