Thursday, October 01, 2009

Notable Linux Command-Line for Internet Use

Query Wikipedia Via Console Over DNS
furynax@paranoid:~$ dig +short txt radiohead.wp.dg.cx

"Radiohead are an English alternative rock band from Abingdon, Oxfordshire. The band is composed of Thom Yorke (lead vocals, rhythm guitar, piano, beats), Jonny Greenwood (lead guitar, keyboard, other instruments), Ed O'Brien (guitar, backing vocals), Coli" "n Greenwood (bass guitar) and Phil Selway (drums, percussion). http://a.vu/w:Radiohead"

Twitter Update From Terminal
curl -u YourUsername:YourPassword -d status="Your status message go here" http://twitter.com/statuses/update.xml

Get Your Tweets From The Command Line
curl -s -u user:password 'http://twitter.com/statuses/friends_timeline.xml?count=5' | xmlstarlet sel -t -m '//status' -v 'user/screen_name' -o ': ' -v 'text' -n

Get Random Futurama Quotations From Slashdot.org Servers
furynax@paranoid:~$ echo -e "HEAD / HTTP/1.1\nHost: slashdot.org\n\n" | nc slashdot.org 80 | egrep "Bender|Fry" | sed "s/X-//"
Bender: My full name is Bender Bending Rodriguez.

furynax@paranoid:~$ echo -e "HEAD / HTTP/1.1\nHost: slashdot.org\n\n" | nc slashdot.org 80 | egrep "Bender|Fry" | sed "s/X-//"
Fry: I must be a robot. Why else would human women refuse to date me?

Download Apple Movie Trailers
furynax@paranoid:~$ wget -U "QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)" `echo http://movies.apple.com/movies/focus_features/aseriousman/aseriousman_480p.mov | sed 's/\([0-9][0-9]\)0p/h\10p/'`

--2009-10-01 17:18:39-- http://movies.apple.com/movies/focus_features/aseriousman/aseriousman_h480p.mov
Resolving movies.apple.com... 58.27.186.99, 58.27.186.16
Connecting to movies.apple.com|58.27.186.99|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26735205 (25M) [video/quicktime]
Saving to: `aseriousman_h480p.mov'