Comments (12)
That is a feature I want to add (which is why I added the ability to log into your account). Then the script would essentially be able to automatically schedule check-ins without any human intervention.
However, it would be very hard to test in a real life scenario. It shouldn’t actually be hard to implement though, so I can look into adding that soon.
from auto-southwest-check-in.
Hey. I haven’t had much time to work on this, but I have done some work on it. You can check the progress in the auto_scheduling branch. Hopefully I’ll have some more time in November to finish this feature before the holiday season.
from auto-southwest-check-in.
Hey @austinliuu and @sdstolworthy. I have finished my refactor of the script which adds this new feature. Please let me know what you think (especially @sdstolworthy as many of your proposed refactors were done) and it would be great if you could test it out (I've tested it locally, but of course it would be better to get outside verification).
from auto-southwest-check-in.
However, it would be very hard to test in a real life scenario.
I think you could definitely test it. Book a couple fully refundable flights. Then, you would just have to remember to cancel right after confirming you've checked in.
from auto-southwest-check-in.
However, it would be very hard to test in a real life scenario.
I think you could definitely test it. Book a couple fully refundable flights. Then, you would just have to remember to cancel right after confirming you've checked in.
But can you cancel for refund after you have checked in?
from auto-southwest-check-in.
Yes, you should be able to cancel it for a full refund (I asked Southwest about this a while back).
I haven’t had time to work on this feature lately, but hopefully I will soon.
from auto-southwest-check-in.
@jdholtz I haven't had a chance to review your branch, but on my flight last night I was looking through the codebase hoping to get together a solution to tackle this. I put together these notes.
Proposed Refactors
1. Account will be decomposed into distinct FlightRetriever
classes
Currently, Account's core responsibility is fetching a list of flights.
However, the class acts differently depending on which parameters it is instantiated with.
For example, it seems that the method get_info
on the WebDriver
class,
invoked by get_flights
on the Account
class, does not work unless a username and password have been provided.
Similarly, get_checkin_info
on the Account
class can only be invoked if first_name
and last_name
are set defined within the class instance.
Currently, those values are only ever set in the constructor, which implies that it is only intended to be used in "reservation" mode.
These classes could be decomposed into FlightRetriever
classes, which expose a common method, get_flights
, which returns a list of flights.
For example, an AccountFlightRetriever
class could handle retrieving flights when a username/password is supplied, whereas a ReservationFlightRetriever
could handle fetching flights where only a first name, last name, and confirmation number are provided.
2. Flight will become a class without side effects, purely a data class
Currently, flight handles logic that is not inhertently related with the flight data itself.
It handles logic around scheduling checkins and sending messages with results
The proposed refactor is to remove all check in and messaging logic from the flight class and create a new class, CheckinScheduler.
The CheckinScheduler class will receive a FlightRetriever
class, and will be able to poll that class for new flights and schedule checkins for those flights.
Account will be refactored to be two different classes that extend a base FlightRetriever
class.
A CheckInHandler
class will handle much of the side effect logic currently handled in the flight class.
FlightRetriever:
get_flights()
CheckinHandler:
__init__(FlightRetriever)
check_in()
Checkin Handler would handle the logic in flight.py
:
_wait_for_check_in
_set_check_in
I think it would solve some of the challenges that exist right now. It might be more extensive than desired though.
from auto-southwest-check-in.
@sdstolworthy this sounds great! I don’t think it would be too complicated because the logic would be fairly simple. The flow would also make a lot more sense with this framework. You can start implementing this if you want/have the time (I’m a little short on time atm).
One thing to note: The account first_name
and last_name
are set after logging in (as the name is what is needed to check in). That logic can be found in the webdriver function get_account_info
.
from auto-southwest-check-in.
I rebuilt the docker image and logged in using my account. After booking a new flight, I can see it successfully picked it up. Thanks for the good work!
from auto-southwest-check-in.
Just be curious, what happen if I later cancel my flight? Would the scheduled check-in be cancelled also?
from auto-southwest-check-in.
Not currently. I think it’ll still attempt to check in and fail. I’ll put that on the to-do list.
I can probably also solve flight time changes by solving this issue (currently, if a flight is scheduled and it’s time changes, a new checkin will be started but the old one won’t be stopped).
from auto-southwest-check-in.
Added in #25
from auto-southwest-check-in.
Related Issues (20)
- Failing to login: Reason: Invalid credentials. Status code: 400. HOT 16
- Fare check index error HOT 9
- Failed to log in to account with username XXXXX. Reason: Invalid credentials. Status code: 400. Passwords with non-alphanumeric characters? HOT 11
- Element click intercepted: Login Button is not clickable (Docker) HOT 13
- ModuleNotFoundError: No module named 'requests' HOT 19
- Forbidden 403 HOT 58
- Encountered a Too Many Requests error while logging in. Skipping reservation retrieval HOT 3
- AttributeError: 'WebDriver' object has no attribute 'add_cdp_listener' HOT 1
- Hang during setting headers_set HOT 7
- Failed to check in due to local time being ahead HOT 17
- Hangs at "Loading Southwest Check-In page" HOT 24
- ModuleNotFoundError: No module named 'requests' HOT 3
- Add devcontainer.json configuration to run the project on GitHub Codespaces
- Continuously hitting 403 error HOT 1
- Add jitter to requests time(s) HOT 1
- Add account / reservation level notification settings HOT 2
- Introduce a custom POST endpoint for "other" notifications HOT 1
- Headers not present on some requests HOT 4
- Reservation monitor hung with lock HOT 6
- Check-in attempt occurred 3 minutes late (didn't sleep computer) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-southwest-check-in.