I built a bot that randomly buys me crap on Amazon and mails it to me. Full description here.
Amazon Random Shopper
Previous post: DropN, or: Why7?
Next post: Darthfield Minus Darthfield
I built a bot that randomly buys me crap on Amazon and mails it to me. Full description here.
Previous post: DropN, or: Why7?
Next post: Darthfield Minus Darthfield
I'm Darius Kazemi. I live in Somerville, MA and I'm glad you're here.
Get smart with the Thesis WordPress Theme from DIYthemes. | Icons by Sylwia Besz | Sitemap XML | Log in
{ 34 comments }
Amazing idea. Would love to see the source code. I want to make one that orders me a book per month.
This is all going to work swimmingly great until a live bobcat shows up at your door.
Obligatory “so this is the Amazon version of that eBay thing from XKCD strip?” comment. :)
DAMN YOU ADRIAN
I’m having real issues with getting the login to work. Are you using CasperJS too or just PhantomJS. I try to do the click and just get an error saying it couldn’t find the selector – which is clearly there.
Are you going to share the code?
Here’s my login code: https://gist.github.com/4072489
(I’m wary about sharing all of my code because I think it violates Amazon’s ToS.)
Thanks for that. I see you’re injecting jquery which might solve the problem.
Not sure why amazon would object to you buying random stuff, even if it’s automated – it’s all money in their pocket :D
If you do decide to share at some point I’d be very interested. Seems like a nice little project and could make for some weird and obscure Christmas presents for my family :)
Actually, I’m getting a similar issue with your code..
TypeError: ‘undefined’ is not a function (evaluating ‘$(‘#ap_email’)')
which is basically what I got, even though the id is there in the source. :/
That error happens when jQuery isn’t injected. Make sure you’re actually injecting it — it’s possible that the path in
page.injectJs(“jquery.min.js”);
is incorrect based on your environment. Another thing you could do is make the injection its own step.
Oh, and I’m using Phantom alone, not Casper.
You are a genius! ^_^
Really, this is an amazing great idea, I really want to try to write a bot like that! (downloading phantomjs this very moment) :-)
Would it be possible to point the bot to a specific Amazon wishlist instead?
Sure, it’s technically feasible. As I mentioned to someone on Twitter, though — I’m mostly interested in having the most alien personal shopper imaginable, like you taught a Martian how to use Amazon and they just don’t understand humans so they click the “buy” button a bunch and there you go.
Well, an interesting fork of this project of yours (and yes, I understand it would be fit for a different purpose) would be something that would do exactly the same for the first interaction, but then explore amazon generated recomendations. Meaning: after you get the first package, you rate each item, and see how amazon responds to your ratings in suggesting something else. I guess that in a few interactions Amazon would be pretty good at recommending you “random stuff” that you still like :-)
Anyway, please keep us updated with the results of each interaction: I am curious on what will shipment #2 bring! :-)
That would in fact be interesting!
I do plan to blog about not just the shipments, but also the evolution of the kind of consumer Amazon thinks Random Shopper is.
This is a great application that I just would love to get a copy of. Hope you share it someday so us non coders can have a go with it (Unsupported ofc and at own risk)
@Darius,
Sounds like a fun app, I love to get packages, and with the cover of mystery, it makes things even better. If not public, would you consider supplying the code privately?
Love that it sent you Noam Chomsky — do you know what word it used to shop and if you do, would you post it with your package unbox?
-L
I don’t know exactly which word (I try to keep it secret from myself to retain the mystery), but it’s pretty clear that in this case it must have been “Cartesian” and “Impulsion”.
You are adorable and this is delightful. Happy Thanksgiving!
That’s so genius. I really wanna learn about coding.. I just don’t know where to begin. recommendations perhaps?
Do you want to learn Computer Science or just programming?
Hey, I saw the mysterious packages in your tumblr. Very very interesting, maybe too much randomness haha but it’s a great app! Are you considering to do it with things you would actually like? I read on your tumblr that this was your first idea, and I think it would be very insteresting too.
Hi Darius,
Inspired by your project, I took a look at javascript and phantomjs. I bumped into the same post on stackoverflow and had some pieces of codes working before I found your gist today. Using essentially the same piece of code in your gist on phantomjs 1.7.0, step 1 shows load started and load completed. However, the page was empty: page.content shows empty . Subsequent console.log(document.title) is empty as well. I am wondering whether the error is only happening on 1.7.0 and that you are using an older version that actually works. Would you be able to confirm what version you are using?
Thank you :)
I’m using 1.7. Not sure what the problem is there.
Do make sure you set your useragent. It’s very important.
Hmm. I am not sure. I will dig into that a bit more tonight if I have time. I am unable to load a different url into page using page.open(). That behavior persists with both pre-compiled binary as well as binary compiled from source. What distro are you using? I am using Archlinux.
Regarding the useragent, I believe it’s implicitly set. However, even when useragent being explicitly defined, it still doesn’t work.
Okay, confirmed. It’s platform-specific error. I am able to run my code and your code just fine on Windows 8 x64. Interestingly enough, on Windows, using page.render(‘target.png’), I don’t see any rendered snapshot on the filesystem. I need to file a bug then. Very odd …
I really like your idea!
I can see some improvements.
How about upping the ante and letting it spend hundreds of dollars worth of crap? Wouldn’t it feel more like childrens christmas if the stuff recieved is expensive?
Also, make sure the account has enough cash and then implement more randomization to when it places orders. This way, you can’t predict when the next thing will come either nor how often.
I’m interested to expand on your concept to build a bot that does my christmas shopping for me by analyzing my friends possible cravings and shop it for them.
Your shopping code combined with some project that analyzes peoples facebook profiles etc. would do the trick.
Granted, it may not buy the best gifts but probably the most memorable ones.
Keep up the good work!
I too would be interested in this code if you can provide it privately.
This is just the type of project that looks like it would be fun to modify and play with. :)
I had a similar business idea, see http://www.iamfeelinglucky.co.uk
But I haven’t had enough time to set this service up. If you were interested, we could talk about that.
I’m unable to work on stuff like this (full time job, no time anyway), but I encourage you to build this! I think it’s a cool idea.
thanks for that project. Thanks to you I discovered Akos Rozmann and bought his album “12 stationer VI”…!
I am endlessly fascinated by Don Buchla’s “Source of Uncertainty” (a module for a synthesizer). You might enjoy that too. (buchla.com)
Love the idea and excited to see what the bot gets you next!
Comments on this entry are closed.