Organise

Search Wikipedia From The Command Line

If you’ve ever had the inclination to look up information using the shell prompt, the Command-Line Fu site explains how to query Wikipedia using the built-in dig utility.

The idea is simple—you can use the dig command to look up DNS records, including text records attached to a DNS entry, and somebody created an interface that pulls back the Wikipedia summary for an article by querying the records from the command line.

To do this for yourself, use the following syntax from your shell prompt, replacing the keyword with the single word you are trying to look up. Because this uses the command-line dig tool, this should work natively on Linux, but Windows users need to have Cygwin installed.

dig +short txt <keyword>.wp.dg.cx

Hit the link for the full explanation, including how to wrap it into a shell script for easy querying from the shell prompt.

Query Wikipedia via Console over DNS [commandlinefu]

Comments (AU Comments | US Comments)

    There are currently no AU comments for this post.

Post Your Comments

Got something to say? There are two ways to comment:

1. Guests

Click here to comment instantly.

2. Facebook Users

Click below to comment using your Facebook account.

We're looking for comments that are interesting, substantial or highly amusing. If your comments are excessively self-promotional, obnoxious, or even worse, boring, you will be banned from commenting. All comments are moderated.