The Block Grabber script is a simple script (Python or shell) that runs on a computer. For initial prototyping, you can use your own personal computer. For a “production” server, the server should be extremely close to the Amazon Flex Blocks server, which is in an instance of AWS in DC somewhere. The script logs into your Amazon Flex account, sends a command to check for blocks (the same as your refresh button on your app), decodes the block information, decides which ones to accept, then accept the specific block. All of this can occur within a few tenths of a second. In some warehouses, this process can be too long so additional scripting needs to be done in order to minimize computations and delays to beat out other scripts. Getting blocks in these warehouses can be impossible unless there are more blocks than scripts or that blocks come out last minute, preventing drivers that are not close by to accept them.
The Amazon Flex login information is not just a simple username and password. It is a digital key that is stored on your phone. You will need to set up your phone so that the internet is routed through a proxy server (your production server). The proxy server can then listen to the login command and capture the digital key. It can then be used by your script to log in. While your phone is linked to the proxy server, you can also check for blocks. The proxy server can output this information and show you what is being sent by your phone (refresh blocks) and what is sent by the Amazon Flex server (block information).