Giter Site home page Giter Site logo

Comments (12)

jdholtz avatar jdholtz commented on July 25, 2024 3

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.

jdholtz avatar jdholtz commented on July 25, 2024 1

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.

jdholtz avatar jdholtz commented on July 25, 2024 1

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.

austinwang14 avatar austinwang14 commented on July 25, 2024

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.

austinliuu avatar austinliuu commented on July 25, 2024

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.

jdholtz avatar jdholtz commented on July 25, 2024

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.

sdstolworthy avatar sdstolworthy commented on July 25, 2024

@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.

jdholtz avatar jdholtz commented on July 25, 2024

@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.

austinliuu avatar austinliuu commented on July 25, 2024

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.

austinliuu avatar austinliuu commented on July 25, 2024

Just be curious, what happen if I later cancel my flight? Would the scheduled check-in be cancelled also?

from auto-southwest-check-in.

jdholtz avatar jdholtz commented on July 25, 2024

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.

jdholtz avatar jdholtz commented on July 25, 2024

Added in #25

from auto-southwest-check-in.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.