Nonbelievers need not apply: Surfraw

I kid about using the command line, but the beauty in it — as any proponent will tell you — is in its simplicity, its speed and its precision. Things get done faster, with less overhead, when they’re done without all the glossy buttons and shiny sliders and whirling doo-dads that encrust most graphical applications these days (Potamus excluded ;) ).

I have been accused of taking it a little too far, by roping two computers through a third, and running the entire show without any graphical element whatsoever. But I am not at the forefront of the revolution. I am not the prophet, just the harbinger for the true believers, the ones who preach reclaiming heathen lands, bearing witness to the truth. That the command line’s love will set you free.

Before you change channels, this time it’s the devs over at surfraw who have this fun sense of humor. Their perspective alone would be worth mentioning, mostly because it lampoons the overzealous Unix fiend who thinks all life should be done at the command line (wait, that could be me … ).

But the fact is that surfraw is a great application too. As I said, console programs are fast and speedy and simple, and surfraw in principle looks rather too simple. This is the first and the last you’ll see of surfraw.

I say first and last, because the next thing you’ll get from surfraw is this:

So where’s the joy in that, you ask? What’s the point in a command line tool that jams a search term into Google? Well it’s not just Google. It’s Google and Amazon. Google, Amazon and Wikipedia. Google, Amazon, Wikipedia, Altavista, the Debian wikis, the Arch Linux package database, currency converters, DMOZ, eBay, gentoo-portage.com, the Pirate Bay, Scientific Commons, w3css, YouTube and about 100 others that are all hard-cued to pop up in your favorite text-based (okay, okay … or graphical) browser.

Oh, but my fingers are tired, you whine. Oh, it’s too much effort to type out the whole word, “surfraw” just to get a quicker jump to a search page. I have a Firefox search bar for that, and it only takes two mouse clicks of my muscularly hypertrophied index finger. (Did you ever notice that? GUI junkies have disproportionately large index fingers. Just kidding, just kidding. … :roll: )

Okay, you can trim down the word “surfraw” to just “sr” and surfraw will still do its thing. Or even better, you can add the location of the surfraw libraries to your PATH variable, and then you only need to type the name of the search engine you want to use. Convenience, at your fingertips (notice the plural :twisted: ).

I know everybody says this, but after a few minutes with surfraw, I was hooked. I usually keep the Scroogle SSL search page as my home page, which keeps me a few keystrokes away from searching whatever for whatever I like. But now I can funnel my search in the direction I know it is going anyway — for example, straight to Wikipedia — and save a step or two.

I hold no grudge against applications that are at a developmental standstill, but surfraw is not one of those. The latest update was a week ago, and the surfraw mailing list is alive with chatter. Check it out and see if the Shell Users Revolutionary Front Against the WWW doesn’t draw you in. Jaunty black beret not included. :D

About these ads

21 thoughts on “Nonbelievers need not apply: Surfraw

  1. Leo Solaris

    I was wondering when you would mention surfraw. I’ve used it off and on, usually when I am exclusively at the console, for a few months.

    By the way, did you notice the page that popped up today on Scroogle? Apparently Google killed one of their pages of results and it killed off Scroogle. I can understand why Google would do such a thing, since they gain revenue on ads, but it still sucks that Scroogle is over.

    Perhaps you should look into alternate search engines for a future post! I suggest ixquick.com or qrobe.it. Both are meta search, but if your attached to Google’s results, qrobe.it parses them while ixquick does not. Ixquick on the other hand does not keep any trace of your searches, has an SSL, and can be used as a proxy. (For the Firefox’ers: they both have search plugins in the addons.)

    Reply
    1. K.Mandla Post author

      I did see the page on Scroogle.org. To be honest, I don’t know what to believe there, although I am saddened if it means the end of their SSL search page. It’s hard to explain, but it was actually more convenient than the regular Google front page.

      I’ll look into those other search engines, and see if either of them suits me. Chances are I’ll just start using surfraw more because of it though. :|

      Reply
      1. mulenmar

        It’s not just the SSL version — just checked the regular version from in Elinks.
        This isn’t good, because I’ve always found Ixquick/Startpage to not provide quite as good of search results.

        Reply
              1. K.Mandla Post author

                You’re right, and I’m not taking the chance any more. I’ve already rebuilt a month’s worth of screenshots that were either on omploader or elsewhere. Yesterday’s project was recovering the 40+ images for the Software page. Slowly but surely. …

                Reply
  2. benj1

    I tend to use this little script http://pastebin.com/yzkYRC9C
    if you like surfraw youll probably like this, you don’t even need a web browser to google as searches get printed to stdout, in nice googly colours :).
    the google update broke it, but its fixed again now.

    Reply
  3. Sean

    This program wanted to install almost 18 MB of libraries on my system when I attempted to try it out. That seemed a bit steep for sleek command line app.

    Reply
    1. K.Mandla Post author

      If I can assume you installed it under Ubuntu 10.04, then it’s possible you installed the recommended packages as well — which probably included surfraw-extra. Try using the --without-recommends flag to install it, and see if that omits the larger -extra package.

      Reply
      1. Sean

        Thanks. I’m on 9.10 and this command, “apt-get –no-install-recommends install surfraw” got it down to 600KB.

        Reply
  4. tetris4

    I ‘ve been using StartPage for some time now and I must admit that although I love their privacy policy, the results leave me rather unsatisfied.
    To fix this, I was using Scroogle in parallel. I was so sad to hear about it going down too, but it’s back up again for those interested!!

    Has anyone here ever tried Google Sharing?

    Reply
  5. T. Winiarski

    Just in case… Scroogle search page is down again – though it maybe for good this time. If You didn`t already, go & see a declaration on their homepage. I still hope it won`t be forever and they manage to come back in the game…

    Reply
  6. shell.person

    Ok, I don’t get it. Am I missing something, or is Surfraw the equivalent of a shell script like this:

    #!/bin/bash
    Search=”$*”
    iceweasel ‘wikipedia.org/search-redirect.php?search='”$Search”‘&language=en&go=Go’

    Reply
    1. K.Mandla Post author

      More or less, yes. Of course, having more than 100 of those already set up is probably part of the convenience of surfraw.

      Reply
  7. ditlhake matshube

    benj1
    I tryed to use ur code it is giving me ds error at

    if len(option) == 0: parser.error(“please enter a search term”)

    loading…
    Usage: document.py [-vr] [–view] [–results][–help] [–version]

    document.py: error: please enter a search term

    i dont know if its what need to outputed because am new to python

    Reply
  8. Pingback: Notes from all over « Motho ke motho ka botho

  9. Pingback: Quick note: goosh.org « Motho ke motho ka botho

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s