Loading
Home ›
Watch the National Debt from the Command Line
Mar 11, 2009 By Mitch Frazier
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!
Trending Topics
| OpenLDAP Everywhere Reloaded, Part I | May 23, 2012 |
| Chemistry the Gromacs Way | May 21, 2012 |
| Make TV Awesome with Bluecop | May 16, 2012 |
| Hack and / - Password Cracking with GPUs, Part I: the Setup | May 15, 2012 |
| An Introduction to Application Development with Catalyst and Perl | May 14, 2012 |
| Cryptocurrency: Your Total Cost Is 01001010010 | May 09, 2012 |
- OpenLDAP Everywhere Reloaded, Part I
- Strip DRM from WMV File
- Validate an E-Mail Address with PHP, the Right Way
- Boot with GRUB
- Why Python?
- A Statistical Approach to the Spam Problem
- Chapter 16: Ubuntu and Your iPod
- Why Hulu Plus Sucks, and Why You Should Use It Anyway
- Building an Ultra-Low-Power File Server with the Trim-Slice
- Science the GNU Way, Part I
- Editorial Standards?
4 hours 9 min ago - Great one
5 hours 43 min ago - Common form in many
6 hours 5 min ago - Awsome
11 hours 8 min ago - Euro 2012 Coupon Codes - Get 20% Off Pavtube TiVo Converter
3 days 9 hours ago - Euro 2012 Big Sale: 20% Off Instant Savings on TiVo Converter
3 days 9 hours ago - MakeMKV works as well, though
3 days 10 hours ago - Euro 2012 Big Sale: 20% Off Instant Savings on TiVo Converter
3 days 10 hours ago - Awesome
4 days 8 hours ago - Who worries approx the
4 days 10 hours ago





Comments
Neater formatting
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
cool
Grepping the GIF for the alt text is a cool idea... I never thought about doing anything like that before. Powerful stuff!
Nice!
Cool tip! Just added it to my .conkyrc!
Use watch instead
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
Fun Find
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'
Socialism is death.
If only there were a way to kick that bum socialist Obama out of the white house from the command line.
$ while true > do > wget
$ 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
Shorter
watch -n 9 "wget -q http://www.brillig.com/debt_clock -O - |grep debtiv.gif |sed -e 's/.*ALT=\"//' -e 's/\".*//' |sed 's/ //g'"National debt... for the USA you mean
I wonder why so many people think locally and act globally... ;)
Very nice tech tip, BTW.
Thanks!
lolz! dDoS
did you do it for the lulz?