Thursday, October 26, 2006

Raw Surfing - To Porn Or Not To Porn

Surfraw. You know you want to.

No, this is not about naked websurfing, although I suspect such an article might be a whole lot more popular. An idea for the future perhaps...

But for now, let us consider Surfraw, a handy command-line program for finding stuff online. No, no, not porn. Well maybe a bit, but not nearly as much as the title of this post suggests. Sorry about that.

In Debian (Etch or Sid) you can install Surfraw using apt. If you would rather use Synaptic for installing software, then you are not really in the target demographic for this program. Please go back to your Firefox, and your Opera, and all those other wimpy graphical thingies.

The Surfraw guys describe sr(Surfraw) thusly:
Surfraw - Shell Users' Revolutionary Front Rage Against the World Wide Web

Surfraw provides a fast unix command line interface to a variety of
popular WWW search engines and other artifacts of power. It reclaims
google, altavista, dejanews, freshmeat, research index, slashdot
and many others from the false-prophet, pox-infested heathen lands of
html-forms, placing these wonders where they belong, deep in unix
heartland, as god loving extensions to the shell.

Surfraw abstracts the browser away from input. Doing so lets it get
on with what it's good at. Browsing. Interpretation of linguistic
forms is handed back to the shell, which is what it, and human
beings are good at. Combined with incremental text browsers, such
as links, w3m (or even lynx), and screen(1), or netscape-remote
a Surfraw liberateur is capable of research speeds that leave
GUI tainted idolaters agape with fear and wonder.


Kinda makes you wonder where those Windows users get the weird idea that we're all a bunch of arrogant pricks, doesn't it.

So, here's how it works:

sr google arrogant pricks
This commands tells Surfraw to search google for the term "arrogant pricks", which will no doubt return a photo of the sr authors. Sr then starts a browser to display the results. If run from a konsole session within KDE, konqueror is used(Actually, to be slightly more accurate than usual, it uses x-www-browser in Debian, which on my system links to konqueror). If run without the X window system Surfraw starts a text mode browser, such as Links, or Lynx. All this stuff is fully configurable, but I won't go into that here, because I am terribly lazy.

sr -elvi
Google is just one of the many search engines Surfraw knows about. "sr -elvi" returns a list of the available engines. Here's the output on my system:

alioth -- Search Alioth (alioth.debian.org)
altavista -- Search the web using Altavista (www.altavista.com)
amazon -- Search the amazon.com bookstore
ask -- Question the web using Ask Jeeves (www.ask.com)
austlii -- Search Australian Law docs (www.austlii.edu.au)
bbcnews -- Search BBC News (news.bbc.co.uk)
cddb -- Search for cd track listings in CDDB (www.gracenote.com)
cia -- Search CIA documents at www.cia.gov
cite -- Search computer science papers (www.researchindex.com)
cnn -- Search on CNN (cnn.com)
ctan -- Search the Comprehensive TeX Archive Network (ctan.org)
currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc)
cve -- Search for CAN assignments in CVE
debbugs -- Search the debian BTS (bugs.debian.org)
debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com)
deblists -- Search debian mailing lists (lists.debian.org/search.html)
deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net)
debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com)
debpts -- Search the Debian Package Tracking System (packages.qa.debian.org)
debsec -- Search the Debian Security Tracker for CVE ids or package names
deja -- Search usenet using Google Groups (groups.google.com)
discogs -- Search the Discogs database of music information (www.discogs.com)
dmoz -- Search the Open Directory Project web directory (dmoz.org)
ebay -- Search the Ebay auction site
etym -- Look up word origins at www.etymonline.com
excite -- Search on Excite (www.excite.com)
fast -- Search the web using FAST Search (www.alltheweb.com)
filesearching -- Search files on filesearching (www.filesearching.com)
foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org)
freebsd -- Search FreeBSD related information (www.freebsd.org)
freedb -- Search for cd track listings in FreeDB (www.freedb.org)
freshmeat -- Search Freshmeat (www.freshmeat.net)
fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org)
genpkg -- Search Gentoo packages (packages.gentoo.org)
google -- Search the web using Google (www.google.com)
gutenberg -- Search for books on Project Gutenberg (gutenberg.org)
happypenguin -- Search the Linux Game Tome (www.happypenguin.org)
imdb -- Search the Internet Movie Database (www.imdb.com)
ixquick -- Search the web using ixquick (www.ixquick.com)
jake -- Search journal/databases in jake (jake.med.yale.edu)
leodict -- Search Leo's German <-> English dictionary (dict.leo.org)
netbsd -- Search NetBSD related information (www.netbsd.org)
openbsd -- Search OpenBSD related information (www.openbsd.org)
pgpkeys -- Search the PGP key database
pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov)
rae -- Busca en el diccionario de la Real Academia de la Lengua EspaƱola (Spanish Dictionary)
rfc -- Search RFCs (internet standards documents)
rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com)
scaleplus -- Search Australian Law using ScalePlus (scaleplus.law.gov.au)
scholar -- Search Google Scholar (scholar.google.com)
scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org)
slashdot -- Search stories on Slashdot (www.slashdot.org)
slinuxdoc -- Search entries in LDP (www.linuxdoc.org)
sourceforge -- Search SourceForge (www.sourceforge.net)
stockquote -- Get a single stock quote (multiple providers)
sundocs -- Search docs on Sun.com (docs.sun.com)
sunsolve -- Search public docs on Sunsolve (sunsolve.sun.com)
thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com)
translate -- Translate human languages (various providers)
W -- Activate Surfraw defined web-browser
w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator)
w3html -- Validate a web page URL with the w3c validator (validator.w3.org)
w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink)
w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org)
wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org)
webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com)
wetandwild -- Real time weather information (many sources)
wikipedia -- Search the free encyclopedia wikipedia
woffle -- Search the web using Woffle (localhost:8080)
xxx -- Superior XXX, hot and ready to press (arXiv.org)
yahoo -- Search Yahoo categories (www.yahoo.com)
yubnub -- Use the social command-line for the web (yubnub.org)

A pretty impressive list. Sadly xxx does not, in fact, refer to a special porn search engine. Again, appologies for the misleading title of this post.

Finally, surfraw-update-path can be used to add /usr/lib/surfraw to your path, which makes it possible to omit the "sr" from search queries. Thus the query above can be reduced to "google arrogant pricks".

1 comment:

Lorraine said...

What is this world coming to? since when is xxx a tech term, I duly object. It's just not right!!!