What? A politician being disingenuous? I'm shocked! SHOCKED!
This is not reddit.
Rick Santorum's Fake Donation Meter
41–50 of 100 posts
Re: Rick Santorum's Fake Donation Meter
#42Re: Rick Santorum's Fake Donation Meter
#43This is used to decide what dollar amount to display on the donation meter on this page: https://www.ricksantorum.com/stillneedhelp/ You can infer from the Javascript, but it just displays a dollar amount equal to the number of seconds elapsed since a certain time (edit: whoops, see below), according to your computer clock. If you refresh every second it will go up by $1 each time. If you set your clock back a year,…
Forbidden
You don't have permission to access /stillneedhelp/ on this server.
Re: Rick Santorum's Fake Donation Meter
#44Re: Rick Santorum's Fake Donation Meter
#45I find it most disturbing that they are polluting the global namespace with all those variables and functions. Don't JavaScript developers these days understand how to properly scope their JavaScript?
Are you really asking why a developer tasked with creating something intentionally deceptive didn't use best practices? I'm thinking not a lot of care or attention to anything was paid that day.
Re: Rick Santorum's Fake Donation Meter
#46Re: Rick Santorum's Fake Donation Meter
#47For comparison, does someone want to post the source code to GMail's meter: "Over 10250.602608 megabytes (and counting) of free storage."
GMail's meter is fine -- it's displaying the state of a value which Google has decreed will increase at a set rate. Unlike Santorum's donations, it's not an unpredictable measurement.
It finds the closest entry in there to the current value of "new Date().getTime()". Then it just adds (what roughs out to) .000004 for every second's difference between the 0 value and the current getTime() value. So today it reads 10250 MB, which must come from index 2 of that array + enough seconds to add 10 MB and some. Definitely more legit than Santorum's.
Here's the code for the counter (it's embedded in that HTML file) http://pastebin.com/8tebjT79
The actual subtractions of the current time from the one in the array seem to be more detailed than what's put on the page, which is being rounded. A sample of input for format():
10250.60874337952
10250.608747448896
10250.608751518273
10250.608755583586
10250.608759652963
10250.608763722339
10250.608767787651Re: Rick Santorum's Fake Donation Meter
#48Re: Rick Santorum's Fake Donation Meter
#49I don't think there's anything wrong, in principle, with this approach, so long as the simulated rate is calibrated frequently to the actual average donation rate. Having it all wired up properly would require a whole lot of infrastructure, particularly for donation mechanisms that aren't online and aren't all tied in to a single system.
There doesn't appear to be anything in this code to calibrate to the actual average donation rate. In fact it's not tied to any real amounts or rates at all. It's just a function of the current datetime. UPDATE: They took the donation page down... Forbidden You don't have permission to access /stillneedhelp/ on this server.
Re: Rick Santorum's Fake Donation Meter
#50Earlier quoted context omitted.
There doesn't appear to be anything in this code to calibrate to the actual average donation rate. In fact it's not tied to any real amounts or rates at all. It's just a function of the current datetime. UPDATE: They took the donation page down... Forbidden You don't have permission to access /stillneedhelp/ on this server.
That was a fast response. Does someone on HN work for Santorum?