r/blog • u/powerlanguage • Apr 01 '15
the button
http://www.redditblog.com/2015/04/the-button.html142
u/j0be Apr 01 '15 edited Apr 01 '15
Here's what is sent to the reddit servers the first time you click.
A "POST" request is sent to http://www.reddit.com/api/press_button with these parameters
seconds:60 prev_seconds:60 tick_time:2015-04-01-16-57-19 tick_mac:105d9bf93e70ec9018b26b5d88ad7f3f6ac9a76d r:thebutton uh:7lr1jvw6rz99c78e982cc86216338a750b75bd03c1d53a24dc renderstyle:html
EDIT: OH SHIT. I GOT THE CHEATER FLAIR!!!
Edit 2: It seems like almost everyone who's clicked it has that flair, though...
E3: Screenshot counting the people's flairs. EVERYONE who's clicked has been marked as a cheater...
E4: Props to the reddit dev for using a web socket connection. wss://wss.redditmedia.com/thebutton?h=4f6fa00141952138bc3f1542067f856fcadb8f1e&e=1427998582
Sample of the output:
{"type": "ticking", "payload": {"participants_text": "97,401", "tick_mac": "105d9bf93e70ec9018b26b5d88ad7f3f6ac9a76d", "seconds_left": 60.0, "now_str": "2015-04-01-18-02-34"}}
→ More replies (35)26
u/j0be Apr 01 '15 edited Apr 01 '15
Here's some of the javascript behind the button
console.log(r.button); Object { _chart: kZ_countdown: function (){ r.thebutton._setTimer(r.thebutton._msLeft), r.thebutton._msLeft=Math.max(0, r.thebutton._msLeft-10) } _countdownInterval: 4_drawPie: function (e,t){ var n=t-e, r=google.visualization.arrayToDataTable([["", ""], ["gone", n ], ["remaining", e ] ]), i={ chartArea:{ top:0, left:0, width:70, height:70 }, pieSliceBorderColor:"transparent", legend:"none", pieSliceText:"none", slices:{ 0:{ color:"#C8C8C8" }, 1:{ color:"#4A4A4A" } }, enableInteractivity:!1 }; this._chart.draw(r,i) } _lastMsLeft: 60000 _msLeft: 59230 _msgSecondsLeft: 60 _onExpired: function (e){ var t=e.seconds_elapsed;r.debug("timer expired "+t+" ago"), $(".thebutton-wrap").removeClass("active").addClass("complete"), r.thebutton._countdownInterval=window.clearInterval(r.thebutton._countdownInterval), r.thebutton._setTimer(0) } _onJustExpired: function (e){ r.debug("timer just expired"), $(".thebutton-wrap").removeClass("active").addClass("complete"), $el=$("#thebutton").parent(), $el.removeClass("unlocked locked logged-out pressed too-new not-active").addClass("denied has-expired") } _onNotStarted: function (e){ r.debug("timer hasn't started") } _onTicking: function (e){ if(!r.thebutton._started){ var t=$("#thebutton").parent();t.is(".not-active, .locked")&&t.removeClass("denied not-active").addClass("active locked"), r.thebutton._started=!0, r.thebutton._countdownInterval=window.setInterval(r.thebutton._countdown, 10) } var n=e.seconds_left;this._tickTime=e.now_str, this._msgSecondsLeft=n, this._tickMac=e.tick_mac;var i=e.participants_text, s=n*1e3;s>r.thebutton._lastMsLeft&&this.pulse2(), r.thebutton._lastMsLeft=s, r.thebutton._msLeft=n*1e3, r.thebutton._countdownInterval||(this._countdownInterval=window.setInterval(r.thebutton._countdown,10)), r.debug(n+" seconds remaining"), r.debug(i+" users have pushed the button"), $("#thebutton-timer").val(parseInt(e.seconds_left, 10)), $(".thebutton-participants").text(e.participants_text) } _setTimer: function (e){ var t="00000", n=(e>0?e:0).toString(), i=t.substring(0, t.length-n.length)+n; for(var s=0;s<4;s++) r.thebutton._timerTextNodes[s ].nodeValue=i[s ];e%100===0&&r.thebutton._drawPie(e, 6e4) } _started: true_testState: function (e, t){ t=t||6e4, $el=$("#thebutton").parent(); var n="denied logged-out too-new has-expired pressed locked unlocked"; $el.removeClass(n), r.thebutton._msLeft=t, r.thebutton.pulse(); switch(e){ case"logged-out":$el.addClass("denied logged-out");break;case"too-new":$el.addClass("denied too-new");break;case"has-expired":$el.addClass("denied has-expired");break;case"pressed":$el.addClass("pressed");break;case"unlocked":$el.addClass("unlocked");break;case"locked":default:$el.addClass("locked") } } _tickMac: "3ea1e09d753004c4d2c94f0810c6e5af5df8b34e" _tickTime: "2015-04-01-17-21-34" _timerTextNodes: Array[4] _websocket: r.WebSocketinit: function (){ if($("#thebutton").length===0) return; this._chart=new google.visualization.PieChart($(".thebutton-pie").get(0)), this._msLeft=0, this._msgSecondsLeft=0, this._tickTime="", this._tickMac="", this._lastMsLeft=Infinity, this._timerTextNodes=[$("#thebutton-s-10s").get(0).childNodes[0 ], $("#thebutton-s-1s").get(0).childNodes[0 ], $("#thebutton-s-100ms").get(0).childNodes[0 ], $("#thebutton-s-10ms").get(0).childNodes[0 ] ], r.debug("in r.thebutton.init()"), this._started=!1, r.config.thebutton_websocket?(r.debug("got thebutton_websocket"), this._websocket=new r.WebSocket(r.config.thebutton_websocket), this._websocket.on({ "message:expired":this._onExpired, "message:not_started":this._onNotStarted, "message:just_expired":this._onJustExpired, "message:ticking":this._onTicking },this), this._websocket.start()):r.debug("didn't get thebutton_websocket");var e=$("#thebutton").parent();e.on("click", function(e){ var t=$(this);t.is(".active.locked")&&(t.addClass("unlocking").removeClass("locked"), setTimeout(function(){ t.removeClass("unlocking").addClass("unlocked") },300)) }), $("#thebutton").on("click", function(t){ t.preventDefault(), t.stopPropagation(); if(e.hasClass("pressed")) return; r.thebutton._countdownInterval=window.clearInterval(r.thebutton._countdownInterval), r.thebutton._setTimer(6e4);var n={ seconds:$("#thebutton-timer").val(), prev_seconds:r.thebutton._msgSecondsLeft, tick_time:r.thebutton._tickTime, tick_mac:r.thebutton._tickMac }; $.request("press_button",n,function(e){ console.log(e) }), e.addClass("pressed").removeClass("unlocked"), r.thebutton.pulse() }) } pulse: function (){ $els=$(".thebutton-container, .thebutton-pie-container"), $els.removeClass("pulse pulse2"), setTimeout(function(){ $els.addClass("pulse") },1) } pulse2: function (){ var e=$(".thebutton-pie-container"), t=this;e.removeClass("pulse pulse2"), setTimeout(function(){ e.addClass("pulse2") }, 1) } }28
u/Yesheddit Apr 01 '15
_setTimer(6e4)
I love how they were too lazy to type 60000
10
u/jesset77 Apr 02 '15
That's not lazy, I do the precise same thing and it's because after a couple of repeated digits it can grow visually tiring to keep track of how many repeated digits there are.. and most languages (including JS) don't allow comma delimiters in literals.
Visually 60,000; 6,000; and 600,000 are easy to distinguish while 600000; 6000; 60000 are a bit more of a chore. OTOH 6e4, 6e3 and 6e6 are both easy to read and cutely short. :P
9
u/Atario Apr 01 '15
Why do you think programmers become programmers? Because they love doing things the long, manual way?
9
u/j0be Apr 01 '15
I found that amusing as well. For a second I thought it might be an attempt at obfuscation.
2
6
u/seagu Apr 01 '15
Any thoughts on what the tick_mac is? I suppose it might be a Message Authentication Code -- some bit of assurance that the user isn't screwing around.
6
u/j0be Apr 01 '15
Well, whatever it is, it changes per second.
r.thebutton._tickMac "f2fc8038e97f86d8ced22e0dcd74ff9a035975ae" r.thebutton._tickMac "f2fc8038e97f86d8ced22e0dcd74ff9a035975ae" r.thebutton._tickMac "0240f364402d9356e68d6f8d64a3cbec6783b783" r.thebutton._tickMac "1b216b31469847dd938e6baeb2047bc2687a90a5"1
2.5k
u/Aaron215 Apr 01 '15
I had better see some INCREDIBLY interesting analytics come out of this. I hope you didn't miss a great opportunity, Reddit Admins.
I wanna see stuff like average time on the page before pushing the button, average visits by non-pushers, correlative data between time (on timer) of push and frequency of upvote/downvotes, who is more likely to use the up and down votes on reddit: Pushers or non-pushers?
And on and on.
→ More replies (82)447
u/bacon_cake Apr 01 '15
Assuming the April Fools joke isn't that the button is just being pressed automatically and there's nothing we can do.
→ More replies (26)
5.3k
u/SnipeyMcSnipe Apr 01 '15 edited Apr 01 '15
This isn't even an April Fools thing, the admins are just trying to make a point that users can't go a minute without pushing the admin's buttons.
Edit: Wow, that was fast -
→ More replies (168)583
u/RockonWeinerdog Apr 01 '15 edited Apr 02 '15
So far, they haven't been able to go a full second with out pressing the button. 59:05 is the lowest I've seen.
edit: I will not be clicking the button. I can't bring myself to do it after watching all the clicks/resets for this many hours. I think I should go have relations with my wife. Something more meaningful anyway, because this is driving me crazy.
edit #2: I just showed my wife this thing. She's not on reddit. I'm in trouble. My wife doesn't yell at me. I didn't watch Mike and Molly with here on the DVR tonight. I've been yelled at...tonight.
704
u/Hecatonchair Apr 01 '15
I saw it go below 30s!
961
Apr 01 '15
I spent an alarming amount of time trying to extract personal information from your screenshot. Sleep well tonight Hecatonchair.
-thepicklewizard
8
Apr 01 '15
that never happened i have been keeping a close eye. It happens when your connection bugs and it goes to zero however this is not the case
3
u/a-s-t-r-o-n-u-t Apr 01 '15
Disconnect your wifi, watch it go all the way http://i.imgur.com/EfLWWRi.jpg
19
Apr 01 '15
I spent an alarming amount of time trying to extract personal information from your screenshot. Sleep well tonight Hecatonchair.
-thepicklewizard
→ More replies (74)2
u/count_niggula Apr 02 '15
Hey man, you use arcGIS? That's cool. We're pretty close now that we had our moment.
4
Apr 01 '15
there are some people tagged with 57s so it must've happened
2
Apr 01 '15
Ive actually watched it for a while and saw it go down to 56. Im on mobile, so I neither care enough, nor know how, to change my flair... La vie
→ More replies (15)2
u/jtriangle Jun 08 '15
Well done abstaining from pressing. You are probably the first proclaimed non-presser and you stuck to your guns; well done.
→ More replies (1)
1.3k
u/Buncs Apr 01 '15 edited Apr 01 '15
My actual theory is that it will go until nobody presses it for 60 seconds and then the last presser will get something special.
EDIT: Could also possibly be whoever gets the closes to 0 before it runs out. The flair on the subreddit tells you how much time was left when you clicked.
62
u/RealSteele Apr 01 '15
So what I'm taking from this, is to not press the button. Eventually the timer will be almost running out, and there will be a competition to be the very last person to click it. At some time in the future this will be huge reddit news. It might be years from now! If anyone had made the mistake of pressing the button, I am willing to sell some alt accounts of mine made before today. $200 each, paypal accepted!
→ More replies (3)67
u/Grayt89 Apr 01 '15
I don't know much about reddit accounts, but I got a buddy that is an expert on them. Let me give him a call and we'll see if we can come to a price
→ More replies (4)218
Apr 01 '15
The 'prize' will probably mean you become CEO of Reddit. May God have mercy on that poor soul.
→ More replies (6)188
u/serfis Apr 01 '15
Eh, not like you've got a whole lot to live up to at this point.
→ More replies (11)793
u/ninekilnmegalith Apr 01 '15
Correct, i watched for 10 seconds and it never made it past 59.5 seconds.
28
u/hadhad69 Apr 01 '15
The clock goes down to about 59.4x but the participant number above it is going up in 30~50/second.
→ More replies (22)423
284
u/like_2_watch Apr 01 '15
Each time the button is pushed reddit donates to Ted Cruz's campaign.
→ More replies (1)199
u/modul8ted Apr 01 '15 edited Apr 01 '15
Was just in the elevator with him yesterday. Best I could do on short notice was give him a funny look.
He definitely noticed and looked uncomfortable.
edit: thanks for the gold! =D
→ More replies (6)40
u/staffell Apr 01 '15
Will it last longer than 24 hours though? This could go on for years.
→ More replies (2)148
u/Leegh229 Apr 01 '15
Only users logged into accounts created before 2015-04-01 can press the button.
With this in mind, someone will eventually be the last presser. Should also note you can only press it once.
→ More replies (12)→ More replies (45)34
39
u/Gypsy_Rain Apr 01 '15
I think I pressed the button? I don't know. I'm in direct sunlight, and am having a hard time seeing my screen.
Have I changed? Has my account changed? WHAT HAPPENED WHEN I PRESSED THE BUTTON?!
cries in corner
→ More replies (4)
742
u/jovdmeer Apr 01 '15
"So when you push this button, two things happen. One: a random person you do not personally know dies. Two: you get a million dollars. Will you push the button?"
51
u/Mastajdog Apr 01 '15
First things first: There's ~7,305,242,025 people in the world. 1,788,652 reddit accounts were active yesterday.
I'm going to assume that only half of active reddit accounts actually see the button, and only half of them hit it. Therefore, my odds of survival are 99.99387906%, give or take.
But, my single decision to hit the button doesn't actually decrease my survival odds. Most people, acting in complete self-interest, will also hit the button. Since me hitting the button actually has a miniscule chance of killing the redditor who would have hit the button that killed me, it's in my own self-interest, both monetarily, and from a survival perspective, I will for sure hit the button.
→ More replies (4)1.1k
u/docbauies Apr 01 '15 edited Apr 02 '15
fuck yes. people die all the time. i need that money.
edit: great, my most up voted comment of all time is about my willingness to let another human being die for my financial gain.
→ More replies (139)369
u/jstrydor Apr 01 '15
Can it be multiple people or am I limited to only being able to kill one?
858
u/atree496 Apr 01 '15
You can't even spell your own name, I doubt you know how to press a button.
→ More replies (82)8
u/Jon76 Apr 01 '15
Yes, can we push the button more than once and get money every time?
→ More replies (2)→ More replies (2)2
u/Shagoosty Apr 01 '15 edited Jan 01 '16
Thanks to Reddit's new privacy policy, I've felt the need to edit my comments so my information is not sold to companies or the government. Goodbye Reddit. Hello Voat.
0
2
u/livevil999 Apr 01 '15
So, if everyone did this then eventually wouldn't you reach a point where everyone left in the world knew each other? What would happen when you pressed the button then?
→ More replies (4)→ More replies (54)1
Apr 02 '15 edited May 20 '16
This comment has been overwritten by an open source script to protect this user's privacy. It was created to help protect users from doxing, stalking, and harassment.
If you would also like to protect yourself, add the Chrome extension TamperMonkey, or the Firefox extension GreaseMonkey and add this open source script.
Then simply click on your username on Reddit, go to the comments tab, scroll down as far as possibe (hint:use RES), and hit the new OVERWRITE button at the top.
1.7k
u/BilliardKing Apr 01 '15 edited Apr 01 '15
wut. Reddit's april fool's prank is a random social experiment?
Edit 1: [Insert obnoxious edit exclaiming "This blew up!" or "wow my top comment ever is about X." here]
Edit 2: [Insert even more obnoxious edit about being gilded here, instead of just messaging the guilder privately. e.g. "THANK YOU FOR THE GOLD SEMPAI"]
Edit 3: PI has concluded that Carly is fucking Mr. X
Edit 4: People are complaining that my parody edits are just as / more obnoxious than the ones i'm parodying. I KNEW THIS WAS THE CASE AND YOU HAVE ALL FALLEN FOR MY OWN SOCIAL EXPERIMENT. MUHAHAHAHA.
→ More replies (198)
0
Apr 01 '15
211
u/electricheat Apr 01 '15
<tinfoil hat> This is actually their way of finding out who controls which accounts, by distracting us with a seemingly- pointless game. </tinfoil hat>→ More replies (16)
278
u/jotted Apr 01 '15 edited Apr 01 '15
I wonder what you have to do to earn a cheater flair.
https://www.reddit.com/r/thebutton/about/stylesheet
edit: huh. Most pressers seems to be 'cheaters'.
3hr edit: People seem to be getting
just'press-6', as of about an hour ago - for getting '60s'.