I really like the DICT protocol dictionary-lookup client that comes with Fink to browse various geeky databases easily in Terminal. However, I wish there was also a wikipedia.org command line client. There´s already a hint here describing how to enter your query from the command line, but search results will still be displayed in a browser window.
I thought lynx, a text-only browser for the Terminal, may be my helping friend, so I modified the script from the previous hint to display search results in the terminal window:
[robg adds: If you don't have lynx installed, you can either use Fink to get it, or install it by going to OSXgnu.org, which is linked from the Apple site above. I actually prefer the links text browser, so I have that installed (via Fink as well). The script above works just as well if you substitute links for lynx.]
I thought lynx, a text-only browser for the Terminal, may be my helping friend, so I modified the script from the previous hint to display search results in the terminal window:
#!/bin/bash
lynx http://en.wikipedia.org/wiki/Special:Search?search=$(echo $@ | sed 's/ /+/g')
Save this to a file -- I called mine wp somewhere in your command path (i.e. /usr/local/bin/), and make it executable by typing chmod 755 wp -- don´t forget to rehash. Now enter wp exploding whaleand read the result within the lynx screen in your terminal window.
[robg adds: If you don't have lynx installed, you can either use Fink to get it, or install it by going to OSXgnu.org, which is linked from the Apple site above. I actually prefer the links text browser, so I have that installed (via Fink as well). The script above works just as well if you substitute links for lynx.]
•
[10,106 views]

