|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Donation Tracking "Thermometer"by hacker (Priest) |
| on Apr 03, 2003 at 18:48 UTC ( [id://247849]=perlquestion: print w/replies, xml ) | Need Help?? |
|
hacker has asked for the wisdom of the Perl Monks concerning the following question:
This is a bit weird, so here's some background...
I host a number of community projects, mailing lists, cvs repositories, and websites on two servers, one on each coast. I pay for all the bandwidth out of pocket, currently, but the popularity of the sites I host is beginning to strain the budget. Recent statistics on the logs indicate we're pushing about 10gb/day outbound (no, it's not pr0n, filesharing, or mp3s ;). I posted an article on advogato on this, and someone suggested (among other things) using one of those "donation thermometers" to do the tracking and incentive push for users. You've probably seen these things on the lawns of high-schools from time to time for different community drives. I think this would be a great idea. I've got some very rudimentary log parsing code (below) that I hacked up just to see how much we're actually pushing from our servers, and was amazed at the results. I'll clean this up a bit soon, but this was a 2-minute hack just to get the values out of the logs:
This code works, and produces output like:
So far, so good. I can get the sizes and total size (not the most efficient way, considering the size of the logs, but it'll do in a cronjob). These projects also have donation buttons to PayPal on them (yes, I know, PayPal.. but it's convenient for the users) and I have perl code (below) that can log into PayPal and extract the payment history as a flat HTML file.
Again, so far so good... so my goal is to try to integrate these, so I can do a bandwidth-over-donations type of "thermometer" that can show me how far we've consumed, and the number of donations given that offset that consumption. I'm talking in CB right now, and there are some interesting ideas being discussed, like using Imager, or GD to generate a graphical representation of the thermometer (something like this graphic or this one I found through google's image search). Has anyone done anything like this? Pointers? Ideas? Other approaches I can take? edited: Thu Apr 3 21:07:13 2003 by jeffa - added readmore tag
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||