Jump to content
Tuts 4 You
Sign in to follow this  
hotpockets

Bot theory?

Recommended Posts

hotpockets

I've been creating bots to purchase items for the last year or two now for my own personal use and it's been a hit or miss. I understand that it's competing with other programs/bots but I just want to get a general idea of YOUR idea of an efficient bot. I believe my bot is as efficient as it can get but I could be wrong so I wanted to reach out and get advice.

 

Currently I am creating my bots using C# and a headless browser. Each product request/purchase is done in an individual async task until it returns successful. The internet speed is about 500 mbps. Basically, I hope to win by numbers. I've met other programmers who claim they didn't use many threads and still able to purchase (and not via backdoor links). I don't have any example code to post up at the moment, I'm in the process of moving my files over.

Share this post


Link to post
kao

Read about high-frequency trading (HFT), there are lots of awesome articles out there. Those guys are insane but the general principles still apply.

In short, there are lots of different variables and they all matter:
* Nothing else matters, if you can't establish connection to the server due to server overload. From what I read, that happens a lot with those Indian servers (railroad tickets, hospitals, visa requests). Making sure you can establish a sufficient number of connections and don't get them killed is the key;
* Internet speed doesn't matter al all, if your packets take 2 seconds to arrive. Connection latency to that specific merchant server is the key;
* Connection speed and latency doesn't help, if your headless browser takes 2 seconds to load and parse the webpage. By the time your browser has finished loading the page, all sales are already finished. Extracting information fast is the key;
* And if you spend 20 seconds waiting for some outsourced service to solve the captcha...
* And so on...

I'm guessing you've made something that kinda works. To get better, you should profile your code and see where the problem areas are.

Share this post


Link to post
hotpockets

I kept all that into account, most of the time I try to have all the data parsed and ready to go. Of course there are some cases I can't do that, and I WANT to try and use mostly POST/GET requests instead of the headless browser but AJAX ruins it for me. Your advice was really helpful and raises a lot of question in my code.

Share this post


Link to post
li0nsar3c00l

Use webrequests insted of a browser, and emulate all the javascripts an such things.

Its way faster, cause you dont actually display the site and dont spent time with the loading of useless pictures, for example

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...