#goats-2.tcl #(aka goats-devel.tcl for dev. versions) # # You will probably be disappointed if you read this source. All it does is # query the database for values which have been inserted by goats-requery.tcl # which is where the more fun stuff happens. # # Why is amzn_goats_url a function when a simple variable would do? Because # this code was created by stripping down a more complex system in which it # made sense. proc amzn_goats_url {} { return "http://s1.amazon.com/exec/varzea/pay/T1IPCIVVU7AQLY" } set amzn_url1 [amzn_goats_url] # # Get's the most recent value in the database. Clicking on the link to goats-requery.tcl # causes new values to be fetched and loaded into the DB. I think this SQL code looks a # little crufty, and there's probably a better way to do this. The nested select statement # means that (failing voodoo query optimization by Oracle) the table has to be "looked at" # twice to answer this query. Fortunately, it's indexed by insertion_date, which is what # is used to restrict in both cases. At any rate, this page gets hit less than 1000 times # per day, so the performance impact is negligable. # set sql_query "select distinct TO_CHAR(INSERTION_DATE,'DAY MON DD, HH:MI P.M.') as date_time, total_money, num_payments from goats_money where insertion_date = (select max(insertion_date) from goats_money)" db_1row get_latest $sql_query set page_content " [ad_header "Goats Rapacious Greed Tracker"]
Goats is a truly glorious comic. You should give them money. Look how much other people have given.
As of $date_time, Goats has recieved \$$total_money from $num_payments separate payments.
This value gets updated every hour, or whenever someone
clicks right here.
Ack! The Rapacious Greed Tracker was broken for a while there. Specifically, the part that queries Amazon for new data and stuffs it into the database was down. When the total money raised went over \$1,000, that introduced a comma into the value. That comma threw off the database. But I've got it back up again (no, not like that you sicko) and all is well.
I couldn't sleep today (wed-thu night), so I wrote this page to track toothgnip's rise to untold-of wealth. Updated! There is now better sleep-deprivation-induced frivolity! We have graphs. And everything's better with graphs. Total and Daily values are shown below. The text-format log is still there, too. This whole thing is very much unlike the Bill Gates Personal Wealth Clock , but vaguely inspired by it. Of course, Bill Gates is more evil than satan himself, and Goats isn't. Well, maybe Diablo is, but he's cute, so it's ok. Dammit. This script is built on the Ars Digita Community System using about 0.1% of the functionality available. After this update, over a full hour of coding has gone into this, so it's now a Finely-Polished Marvel of Software Engineering, which means that is has purty pitures. Enjoy!
New! (Feb 26) Enough time has passed that the hourly graph was getting silly. So now we have a daily graph. If you want the hourly graph, it's right here for your benefit.
| Total $ | Daily $ |
| $total_graph | $daily_graph |
What sort of crazy wierdo would write this thing? I would. If you think of any improvements, e-mail me. eanderso@usa.net.