Watch the National Debt from the Command Line

March 11th, 2009 by Mitch Frazier in

Your rating: None Average: 3.4 (30 votes)

This is Tech Tip Video Contest Week (March 9 - 13) at LinuxJournal.com!

Want a free 1-year digital subscription to Linux Journal? This is your lucky week. Watch the daily Tech Tip videos this week and collect the secret letters hosts Shawn Powers and/or Mitch Frazier announce during the videos each day. Come this Friday, unscramble the letters to reveal the secret word(s). Everyone with the correct answer who responds by 11:59:59PM U.S. Eastern Daylight Time March, Friday 13th, 2009 wins a free digital subscription to Linux Journal -- it's that easy!

Follow this link for further contest details, and good luck!

Download in .ogv format
__________________________
Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous's picture

Neater formatting

On April 18th, 2009 Anonymous (not verified) says:

while true; do echo -ne "`wget --quiet http://www.brillig.com/debt_clock -O - | grep debtiv.gif | sed -e 's/.*ALT="//' -e 's/".*//' -e 's/ //g'`\r"; sleep 1; done

Tuxly_Tuxford_McTuxtington's picture

cool

On March 19th, 2009 Tuxly_Tuxford_McTuxtington says:

Grepping the GIF for the alt text is a cool idea... I never thought about doing anything like that before. Powerful stuff!

Sean Corbett's picture

Nice!

On March 13th, 2009 Sean Corbett (not verified) says:

Cool tip! Just added it to my .conkyrc!

Dan Fekete's picture

Use watch instead

On March 12th, 2009 Dan Fekete (not verified) says:

You can also use watch to run programs periodically. Try this:


$ cat > nationaldebt
#!/bin/bash

wget --quiet http://www.brillig.com/debt_clock -O - | grep debtiv.gif | sed -e 's/.*ALT="//' -e 's/".*//' | sed 's/ //g'

$ chmod +x nationaldebt

and run it like so:

$ watch ./nationaldebt

Brett Dreher's picture

Fun Find

On March 12th, 2009 Brett Dreher (not verified) says:

Nice find, tweaked it slightly with another sed statement (i'm no expert with sed/awk and regex) to trim the spaces from it in a small bash script now, my final version:

#!/bin/bash
wget --quiet http://www.brillig.com/debt_clock -O - | grep debtiv.gif | sed -e 's/.*ALT="//' -e 's/".*//' | sed 's/ //g'

Anonymous's picture

Socialism is death.

On March 11th, 2009 Anonymous (not verified) says:

If only there were a way to kick that bum socialist Obama out of the white house from the command line.

Anonymous's picture

$ while true > do > wget

On March 11th, 2009 Anonymous (not verified) says:

$ while true
> do
> wget --quiet http://www.brillig.com/debt_clock -O - | grep debtiv.gif | sed -e 's/.*ALT="//' -e 's/".*//'
> sleep 3
> done
$ 1 0 , 9 5 9 , 5 0 2 , 1 4 8 , 9 8 5 . 0 4

amygdala's picture

Shorter

On March 13th, 2009 amygdala says:

watch -n 9 "wget -q http://www.brillig.com/debt_clock -O - |grep debtiv.gif |sed -e 's/.*ALT=\"//' -e 's/\".*//' |sed 's/ //g'"

Anonymous's picture

National debt... for the USA you mean

On March 11th, 2009 Anonymous (not verified) says:

I wonder why so many people think locally and act globally... ;)

Very nice tech tip, BTW.

Thanks!

Anonymous's picture

lolz! dDoS

On March 11th, 2009 Anonymous (not verified) says:

did you do it for the lulz?

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.


Read this issue