I hacked the Amazon Dash Button to click Meh at meh.com instead of ordering Tide
76Background
If you're stumbling onto this post from Google or Reddit or Hacker News or wherever, you might not be familiar with meh.com. It's a daily deal site started by the guys who were behind woot.com, eventually sold it to Amazon, then moved on to build meh.com.
Meh.com offers one deal every day. On the homepage you'll find two buttons, "buy it" and "meh". Clicking the "buy it" button obviously leads you into the checkout process. Clicking the "meh" button flips the button over to reveal the meh face of the day.
Meh.com fans try to click the meh button every day to grow their collection. We keep stats on all the meh button clicks. Some users compete to collect them all. Others try to make silly designs. It's like, a thing.
Amazon Dash Button
The Amazon Dash Button is a small device with WiFi, a battery, and a physical button on it. You can buy them from Amazon for $5 and set them up to order certain products from Amazon when they're pressed.
It's a neat idea, but I wanted to see if I could make the Amazon Dash do other things when I pressed the button... like clicking the "meh" button on meh.com.
Standing on the shoulders of giants
What I found out is that, when pressed, the Amazon Dash button sends an ARP request across your network. You can use simple packet capture software to sniff the ARP request as a quick and dirty way to detect when the Amazon Dash button has been pressed.
Lucky for me, a couple of guys already did some of the really hard work. My project uses a nice little Node.js module called node-dash-button from Alex Hortin. His module is based off this excellent article by Ted Bensen.
Getting started
- Get an Amazon Dash Button
- Follow the instructions to setup your Amazon Dash Button with the Amazon mobile app. Complete the first two steps to connect your Amazon Dash Button on your WiFi network.
- Don't complete step three where it asks you "Which product do you want your Dash Button to reorder whenever you click it". Just exit the app.
Discovering your Amazon Dash Button's MAC address
Here's where things get tricky. You're going to need to have Node.js installed and you're going to need to download my meh-dash-button code. From the directory where you downloaded the code run these commands:
npm i
to install the code's dependenciessudo node app.js find
to start listening for ARP requests on your network
The application will start listening for ARP requests on your network and displaying any MAC addresses it finds. If your network is anything like mine you'll see quite a few devices show up. I usually let it run for about a minute so that when I press my Dash button I'm fairly confident I've isolated the Amazon Dash device.
Once you have your Amazon Dash button's MAC address you can quit the program. Update line 4 of the app.js file with your Amazon Dash button's MAC address.
Clicking the meh button
Update line 5-6 of the app.js file with your meh.com username and password. Now that we can detect Amazon Dash button clicks the program uses a web browser automation library called Nightmare to sign you into meh.com and then click the meh button for you.
- Run the app using this command:
sudo node app.js
- Click the Amazon Dash button
- Wait a while for Nightmare to do its browser automation
- Open meh.com in your web browser and you should see the meh button has been clicked for you
- 29 comments, 42 replies
- Comment
bravo, sir. bravo.
Now that this is done, when can I expect to purchase these on Meh?
@shawn Congratulations...
Now to really impress me, make it log me in to my account, buy, confirm that I want buy, confirm that I'm not a robot, and finally with my default payment and shipping address, (especially on fukubukuro days)
That would impress me... Feel free to then to send the button and a the code running on a small low power device... or so that I could insert the code on something like a Synology DS415+ (or really impress me and get it to run on my current DS209+)
@sohmageek Just run the code on a RaspberryPi server...
@Bogie that could work... but I'd need a RaspberryPi
@sohmageek They're only ~$40. Which has me thinking. I have a Pi sitting around, is it worth $5 to try to recreate this?
@Bogie The answer is yes, yes it is.
@Bogie Better yet, instead of using a Dash Button, I'm pretty sure there's an NPM module that lets node.js interface with the Raspberry Pi's GPIO. Therefore, you could hook up a breadboard with a button on it and have that button kick off the Nightmare process.
@lljk I have a breadboad button too, but it's not a wireless solution ;)
@Bogie Well, yeah. Considering the nature of meh.com, I figure anyone on this site would want the cheap solution first. :P
This is pretty amazing. Thanks for sharing your process (though it's still Greek to me). I think I'll continue just loading the page and clicking my 'meh' so I can see what you're actually selling and all.
@PurplePawprints we'd prefer you did exactly that, but I couldn't resist tinkering around with the Dash hardware
@PurplePawprints you spelled "Geek" wrong
@shawn Now if you'd hack the buy button on woot so that instead of buying there it brings you here... just sayin'...
Really cool. I hope you did this during work hours.
Where was this a few weeks ago when the site refused to recognize that I clicked it and thereby losing a 344+ streak?!?
This is really cool, thanks for sharing. Does a second click un-meh the face like a toggle? Or its it a one-time transaction?
@ACraigL Once you meh, you cannot unmeh. Second thoughts are not allowed.
@PurplePawprints Oh, right. Duh. Moving on...
@PurplePawprints You can, of course, still buy the item, unless it's sold out. This creates a conflict in OCD people who are on the site at midnight, who want to buy the item, and who must fight their compulsion to click 'meh' before they click 'buy it'. Because, you know, fukus and 64 GB drives and StickUp speakers are what we're here to get- but there's a 'meh' button we haven't clicked.
@OldCatLady I always click ‘meh’ first, then decide whether or not to buy (usually not) --but it does allow purchase after meh-ing
I've been waiting for this
mannnnn somehow this being a physical button rather than something like a command line routine makes it so much cooler
because reasons
@Lotsofgoats Yup. Now he just needs some bulky mechanical timer that'll physically push that button a couple minutes after the daily change-over. That'd be much cooler than just having some program scheduled to run.
@Lotsofgoats @medz nah having a physical button to press every day would make me more likely to daily press the button...kids like pressing buttons, dogs like pressing buttonsnI like pressing buttons ....it's just...a fun thing to do...I guess
Ohh, so this is the goat prize!
@Thumperchick I'd take it.
@Thumperchick the goat prize version of this just plays the price is right loser horn
Hmm... Having a bot do you Meh for you seems kind of like cheating. I'll just do it the old fashioned way... 457 in a row and counting.
@BillLehecka Me too. I've gotten a bit lazy lately, so I'm actually surprised I've made it this far.
@BillLehecka you still have to press it though...it is just more buttony and less clickity
@BillLehecka Plus it will inevitably fail. Think of how pissed people are gonna be the day their streak is broken. I had several early failures (I swear to God I clicked on some of those days, but oh well): 448 total / 229 streak.
@BillLehecka Even though I told myself I'd write a little cron job to run a phantomjs job (and email screenshots)... it has been 5 months and I haven't done it yet. Still rocking the streak, though, even though I missed the Kickstarter so I'll be 1 day behind, forever. C'est la vie.
I find this to be moderately interesting. Thank you.
Hahaha. Further endearing yourselves to Bezos. This is Great!
To get the MAC address, can't you just look in your router log?
Neat project though. You can't convince me to start clicking the Meh button again. I lost my streak and I'm not going back.
Wait... we're not just supposed to click meh when we don't like the product? Dang, I've been missing out on faces.
@Cappo - Welcome to the life of a clickface slave.
@Cappo This is like meh 101. Which is okay, because folks are generally remedial around here, so meh 101 is practically grad school.
@Cappo He who dies with the most meh faces, wins.
Edit: In all likelihood, the meh gods probably intended the button to function as a dislike meter for deals. (to know which item was the worst or most "meh") Now it has evolved into something of a competition and collection habit that gets their site some traffic everyday so they embrace it. Sorta like why sites have daily surveys: it gives people a reason to visit and interact even if they're not buying crap.
@medz I guess that's my problem, I have a history of sticking to original usage. Heck, I still know the difference between "newb" and "n00b" while the rest of the internet these days seems to think they're interchangeable spellings.
Listen, I'm an idiot, but it sounds like you just figured out how spend 5 bucks without really trying.......good for you!
@somf69 It's just one of those "because I can" things. Was it somehow needed? Not really. He did it just to do it.
@somf69 not only that but giving the 5 bucks to the competition
Has anyone made a MEH label to go over the dash button?
@rileyper I made one to go over the Staples Easy Button. Does that count?
@heartny Did you make it say "Meh" when you press it?
@lowerone Actually, I have a recordable Easy Button, so I should record "Meh" and slap a Meh label on it.
@rileyper Does anybody here have a 3D printer? Meh drop-in replacement button for Staples easy button.
Cool. And you'll get (at least deserve) a small bonus from @snapster for driving new eyeballs here with this exploit!
BTW, I understood about 65% of that explanation. Hopefully the code running in that window is not a drive by attack on our PCs.
Ok, I want to say "meh" (because). But this is too cool a misuse to not applaud it.
So, "meh!"
@sligett it has to have an @matthew voice over saying meh
By the way - now that you did not order tide are you going to have to live in a closet at meh because your clothes stink?
This is pretty cool.. But now that the code is out there to easily automate clicking the meh button, why not just make a cron job to click it at 1am every day? No more broken streaks!!!
Just don't change the website code to order Tide when I click the Meh button.
@walarney no promises
Am I the only one that appreciates the irony that there is a Dash button buy Tide, but not one to actually buy Dash
@DrWorm No way to reorder Mrs. Dash, either.
Loading nightmare.js for this is massive overkill. Just use request to make the equivalent HTTP requests directly from Node.
@stuartpb do it and send a pull request
@shawn Hmm... you know, nobody's really made a module as simple as nightmare.js for just requesting pages and doing straight form submissions (which you'd need to do here due to the CSRF tokens), but there's no reason it can't exist.
Challenge accepted.
Hm. What about people who log in with Google and don't have a username and password?
@michabailey You'll modify the workflow with Nightmare.js to cover your login case.
Can you repeat the part about the thing that goes through the thingamajig…Not to say that went over my head, but…
I absolutely wish I had this kind of free time…
not naming names…but some people have way too much time
probably fair, since you dug up a thread from over a year ago
@jpc I might be to blame for that…
@hanzov69 No you will never be to blame… that is the goat’s job.