Thursday, December 16, 2010

Revving Chrome for a Cause

Google's launched this great initiative/Chrome extension called "Chrome for a Cause," where for every tab opened (up to 250 tabs/day) Google will contribute towards charity. You can download the extension here:

http://www.google.com/chrome/intl/en/p/cause/

Now let's say you're in the mood to speedily log 250 tabs open, but your Ctrl+T muscles are sore. Several code solutions have popped up, including a full-on Chrome extension which automates the process.

My question: why can't this run in Javascript?

My response: Chrome for a Cause Fastest bookmarklet

Here's the code:
javascript:i=260;function addTab(){if(--i==0){clearInterval(j)}x=window.open('');x.close()}j=setInterval('addTab()',1000);void(0);

Just let it run for ~5 minutes, and you're done. You've helped provide a year's supply of clean drinking water for someone on earth.

5 comments:

LeftClicker said...

Wow! That's really cool! I just provided 10 vaccinations, 25 books, 1.3 person's clean drinking water, 2.5 square feet of shelter or 25 new trees. Thanks for helping make this a better planet!

Andre said...

/unrelated to this blog post Your code sample on the MIT guestbook is way too easy....it's a Hello World! program written in brainfuck.

Personally, I prefer this language:

Ninjinuity said...

@ Andre
Which Language? And Yea, the Hello World Program was a little too easy. Should have made it say "Hello MIT '15!" or something.

scikidus said...

The code was more a psychological test to find those few who would actually bother to figure it out.

Also, Andre, kudos for the whitespace.

Ninjinuity said...

Ah. I get it. Silence. Doh.

Also, here's my best shot at a "Hello MIT '15" Program.

>+++++[<+++++>-]<[>++++>+++>+>++<<<<-]>>---.<+.+++++++..+++.>>+++++++.<+++++.----.+++++++++++.>.<++++++++++++.>>-.++++.<+.