Wikipedia from the Command Line February 9, 2006
Posted by Carthik in ubuntu.trackback
Philippe Charest shares his home-brewed bash script to get information from Wikipedia on the command line using lynx.
You may have to install lynx first using:
$sudo apt-get install lynx
Phillippe says:
Nice blog by the way, I just wanted to share a new quick “hack” to obtain information from wikipedia on the command line.
Here is a dirty script that fetches information from wikipedia using lynx:
Into your favorite editor:
#!/bin/bash
lynx -dump "http://en.wikipedia.org/wiki/$1" | lessThen just make the file executable (
$sudo chmod +x
) and in your path (or in/usr/bin
)Exemple (I named my script wikid)
$wikid "George Bush"
returns:
…
George BushFrom Wikipedia, the free encyclopedia.
Jump to: [6]navigation, [7]search
George Bush can refer to:
People:
* [8]George W. Bush, George Walker Bush, the 43rd and current
[9]President of the United States of America ([10]2001-present)
* [11]George H. W. Bush, George Herbert Walker Bush, 41st President
of the United States ([12]1989-[13]1993), and father of George W.
Bush…
It would be more useful to open up firefox, but this is really cool, regardless
In a similar vein, WWW-Mediawiki-Client allows one to edit MediaWiki content from the command line, using their favorite text editor.
(See here for a Debian package and some basic instructions.)
[…] Was reading the ubuntu blog today and found this kool little script you can make so you can access Wikipedia via the command line by just creating this little bash script and using lynx which is a text based browser you can use with linux and the terminal screen. […]
[…] Kata ubuntublog di wordpress, pake code: #!/bin/bash lynx -dump “http://en.wikipedia.org/wiki/$1” | less […]
Hello benplaut;
>>It would be more useful to open up firefox, but this is really cool
#!/bin/bash
firefox “http://en.wikipedia.org/wiki/$1”
should do the job (-;
As for those who like w3m, use this:
#!/bin/bash
w3m “http://en.wikipedia.org/wiki/$1”
Nice script. Thanks. 🙂
Good tip! And I use this for dictionary look-ups:
#!/bin/sh
lynx -dump -nolist -pseudo_inlines \
‘http://dictionary.reference.com/search?q=’$1’&r=67’ \
| tail -n +13 | less -r
Really kool! So I can get even more i guess from that. Thnks
“WikipediaFS is a mountable Linux virtual file system that enables you to deal with Wikipedia articles as though they were real files on your hard drive.” [ http://wikipediafs.sourceforge.net/ ]
if you add -nolist the annoying numbers in front of the links will go away.
[…] Texto original (inglés) | Ubuntu Blog. […]
I like Opera:
#!bin/bash
opera “w $1”
[…] (Ubuntu) Friday, November 14th, 2008 | Author: admin Pues el otro día me encontré con este post que nos describe una forma fácil de acceder a Wikipedia desde la línea de comandos. Voy a […]
It would be more useful to open up firefox, but this is really cool, regardless
Really kool! So I can get even more i guess from that. Thnks
medical hcg diet
Wikipedia from the Command Line | Ubuntu Blog
Enhance the effect of an elliptical machine as a 24hr fitness
trainer, by deciding upon a machine that also capabilities handlebars for a incredibly effective total human body exercise.
One has to wonder how Kenya’s fitness DVD has become
such a huge hit in Japan. You need to find a way to change
the way you think about food, in order to avoid the bad habit of overeating.