TFL: Difference between revisions
mNo edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
Here are the instructions to prepare! Let me know if anyone has any issues, we can work through it. | Here are the instructions to prepare! Let me know if anyone has any issues, we can work through it. Make sure you have Google Chrome installed before doing these steps. | ||
== Download the Bot Script that I Emailed You == | == Download the Bot Script that I Emailed You == | ||
Line 23: | Line 23: | ||
Then run this command: | Then run this command: | ||
chmod 755 ./ | chmod 755 ./reserve_tfl_bot.py | ||
That second command makes the script '''executable'''. Which means we can now run the program. Both of those commands won't really give you feedback, then will simply work and not give you any errors hopefully. | That second command makes the script '''executable'''. Which means we can now run the program. Both of those commands won't really give you feedback, then will simply work and not give you any errors hopefully. | ||
Line 44: | Line 44: | ||
cd Desktop | cd Desktop | ||
./ | python3 ./reserve_tfl_bot.py | ||
It will spew a bunch of text to your terminal window, but the main thing is that is should '''also''' open a Google Chrome window on the TFL reservation page, quickly check available dates and times, and if it doesn't find any, it will quickly close the Chrome window, then open a new one and repeat until it gets a hit. If it finds a time, it will then stop and wait for you to name and contact information, credit card number, etc. If you get to that point, I will send you my credit card info immediately so you can enter it. | It will spew a bunch of text to your terminal window, but the main thing is that is should '''also''' open a Google Chrome window on the TFL reservation page, quickly check available dates and times, and if it doesn't find any, it will quickly close the Chrome window, then open a new one and repeat until it gets a hit. If it finds a time, it will then stop and wait for you to name and contact information, credit card number, etc. If you get to that point, I will send you my credit card info immediately so you can enter it. |
Latest revision as of 13:50, 24 October 2024
Here are the instructions to prepare! Let me know if anyone has any issues, we can work through it. Make sure you have Google Chrome installed before doing these steps.
Download the Bot Script that I Emailed You
It should be called reserve_tfl_bot.py. Save this to your Desktop (which is located as /Users/your_user_name/Desktop).
Find the Terminal Application
Find the "Terminal" application on your Mac. Every Mac has it. You can do a search for it in "spotlight" (the little magnifying glass on the top right of every Mac Desktop screen). It's also in your applications folder (in the "Utilities" sub folder). Once you find it, drag the application icon to your dock to make a shortcut for it.
Prepare the reserve_tfl_bot.py Script
Once you have the terminal open, it will look like a white box waiting for you to type in text. This is what is called a "UNIX command line". There are only a couple things you will need to type in here to prepare.
The first thing you should do in the terminal is navigate to the Desktop. This basically changes your current working directory to be your Desktop in the terminal:
cd Desktop
Then run this command:
chmod 755 ./reserve_tfl_bot.py
That second command makes the script executable. Which means we can now run the program. Both of those commands won't really give you feedback, then will simply work and not give you any errors hopefully.
Install Selenium
The next thing you need to type in is:
pip3 install selenium
This is basically installing a Python module that will enable the script to control a Google Chrome window. It should run without any errors, and should look something like this:
Run the Bot!
If you have any Terminal windows open from before, let's close them and open a new one. Once you open a new Terminal window, you can test your bot code by doing:
cd Desktop python3 ./reserve_tfl_bot.py
It will spew a bunch of text to your terminal window, but the main thing is that is should also open a Google Chrome window on the TFL reservation page, quickly check available dates and times, and if it doesn't find any, it will quickly close the Chrome window, then open a new one and repeat until it gets a hit. If it finds a time, it will then stop and wait for you to name and contact information, credit card number, etc. If you get to that point, I will send you my credit card info immediately so you can enter it.
If you need to get it to stop checking, which you will need to do to stop testing, or if we "win" and get a reservation, just click on the terminal window, and hit "Control C" a bunch of times, and it should stop.
When the time comes, we will all run this step about 30 seconds before 10:00am on November 1st. Then we wait and cross our fingers!