3 thoughts on “Search Wikipedia from Command Line

  1. Hi Binny. This is a really interesting idea, but I couldn’t get it to work, always getting only the error message:
    ;; connection timed out; no servers could be reached”

    Could it be the address is incorrect? How did you come up with the address:
    something.wp.dg.cx

  2. Thanks Binny.
    I’m not sure how it works, but it looks to me like the script that serves this has stopped. More can be read about it here:
    https://dgl.cx/wikipedia-dns

    I have a rather clumsy substitute:
    lynx -dump ‘http://en.wikipedia.org/wiki/Special:Search/’ | head -n50

    Omitting the pipe to the head command (which, as I give it, only shows the first 50 lines) instead outputs the whole page as text. This has some advantages over the original server, which was limited to about 400 bytes, but unfortunately doesn’t display just the introductory paragraph, including all the navigation stuff as well.

    I could simply use wget with the same kind of link above to download the page and select out the introductory paragraph using sed or awk, but I’m supposed to be working. 🙂 So I’ll do it later and try to remember to post my results here.

Leave a Reply

Your email address will not be published. Required fields are marked *