Tuesday, April 7, 2015

Constructing The Button

If you haven't heard of The Button, it's a social experiment and ongoing April Fools gag hosted on Reddit.  

From the announcement:
The timer will count down from 60 seconds. If the button is pressed the timer will reset to 60 seconds and continue counting down. Only users logged into accounts created before 2015-04-01 can press the button.
You may only press the button once.
We can’t tell you what to do from here on out. The choice is yours.

I'm working on a project that will display the number of participants and time left, and allow you to press a real-life button that results in a button press on Reddit. So far I have the screen, but I think it's the hardest part. The RPi gets values from a Firefox window and updates the screen every quarter second. There is some delay, but it's not too noticeable.

Here's how it works.  I have a snippet of Javascript that checks when the participants field has been updated.  That sends a POST request to a local webserver with the new count.  The CGI is written in Python, and it writes the count and current time to a file.  Another background process updates the screen.

I'm waiting for this to arrive at my house, but the seller doesn't seem to want to ship it.  Hopefully the button will keep being pressed until my 7-segment display gets here.

In the meantime I'm picking up a pressbutton, enclosure and new computer mouse from Radioshack. 

No comments:

Post a Comment