Over the break, among other things, I learned (through practice) the fundamentals of Java (For everything else, I just use Google) and as my first project in this language, I wrote a (client-side) Java application for my FreeRice AutoClicker 1.4 (for those who don't remember).
Besides the fact that it's now written in Java and is not meant to be run on a webserver? (It actually runs on this server, though)
So, what does all that mean? As a result of these changes, the application executes around four times faster than the PHP-CLI version.
As always, the well-documented source code (the .java file) is provided for entertainmenteducational purposes. If you don't believe that the application can actually ping freerice.com that fast, you can set forceCheck (defined at the beginning of the class definition: private static final boolean forceCheck = false;) to true and the script will manually confirm that each submission counts by looping through the output stream line-by-line and checking whether the keyword "correctDef" is present (you have to recompile the .java file, though). But I warn you that setting forceCheck to true will slow execution considerably since it requires the application to wait for the freerice.com server to completely respond, so this might not be the best idea if you just want to donate a bunch of rice.
You probably have some version of Java installed on your machine, so open a terminal (on *nix systems)/DOS (on Windows) and cd to the directory containing the .class file, type java FreeRice, enter, and you're set. If you don't have the guts to trust my compilation, you can download the source code, review it for possible exploits (trust me--there are none), and compile it yourself (cd to the directory containing the .java file and type javac FreeRice.java)--then follow the instructions above to execute the compiled .class file.
Possibly a version written in C# (to run on Mono on *nix systems or .NET on Windows), C++ (individual compilations) or Python.
Enjoy, and don't forget to Digg & StumbleUpon this article and join other skeptics at Facebook so you can help others discover how to alleviate world hunger (if it isn't a scam)! Also, I urge everyone to post their donation totals--I'm curious how large of an impact this application can make.
| Attachment | Size |
|---|---|
| FreeRice.class | 4.64 KB |
| FreeRice.java | 6.07 KB |
Comments
My Donation Totals
Jan 19-20: 2804720 (on cory.eecs.berkeley.edu)+2804940 (same)+11849540 (locally overnight)=17459200 grains
Jan 18-19: 3859420 grains (locally overnight (using the second version))
Jan 17-18: 2510680 grains (locally overnight (using the first version))
Not bad. I got just over 30
Not bad. I got just over 30 million last night. I start off at about 800 grains per second, but after the amount of "timing outs", it stays at around 550 grains per second total. Not as good, but still not bad.
o_O We better see a sharp
o_O We better see a sharp spike in FreeRice.com donations. But, from freerice.com:
January 18, 2008 165,361,240
January 19, 2008 99,622,060
Um, what?
Hmm, it's almost as if we've
Hmm, it's almost as if we've been taking rice away from them.
I'm going to leave mine running for 24 hours, starting at midnight, and we'll see how much it accumulated in a day. 50,000,000 wouldn't hurt.
Yeah
That's what it feels like, at least. If we donate 150 million grains and the site only shows 149 million (or any number < 150 million), we've just proved that the site is either bullshitting or just putting a facade just for my script.
Rice totals
January 18, 2008 165,361,240
January 19, 2008 99,622,060
January 20, 2008 96,471,120
o_O And we donated a shitload.
I alone had over 30,000,000
I alone had over 30,000,000 yesterday. In all likelihood, this is a scam, but all we need to do is prove that 60 million regular visitors suddenly stopped coming.
In less than 5 minutes, I will have passed the 200 million mark, so in addition to whatever you and everybody else has donated, we will have sufficient proof, unless your script is somehow taking their rice away (wouldn't that be funny).
Well, if the script is
Well, if the script is somehow taking their rice away, we still have sufficient proof that FreeRice isn't donating the amount it purports to donate. The app only reaches X grains donated when the website tells you that you have X/20 "Correct" submissions. If it does not donate X grains of rice for every X/20 correct submissions, the site is lying and therefore is a scam.
It's official. Yesterday's
It's official. Yesterday's donation total: 111,103,240
Our donation total: 278,000,000+
Significantly less than half of what we donated. FreeRice.com is a scam.
Good job.
Good job.