This entry was posted
on Friday, August 29th, 2014 at 12:18 pm and is filed under Command Line.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
3 Responses to “Search Wikipedia from Command Line”
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.