January 2004
Intermediate to advanced
368 pages
7h 25m
English
In addition to grabbing information off web pages, a shell script can also feed certain information to a website and scrape the data that the web page spits back. An excellent example of this technique is to implement a command that looks up the specified word in an online dictionary and returns its definition. There are a number of dictionaries online, but we'll use the WordNet lexical database that's made available through the Cognitive Science Department of Princeton University.
Learn more
You can read up on the WordNet project — it's quite interesting — by visiting its website directly at http://www.cogsci.princeton.edu/~wn/
#!/bin/sh # define - Given a word, returns its definition. url="http://www.cogsci.princeton.edu/cgi-bin/webwn2.0?stage=1&word=" ...
Read now
Unlock full access