Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domestic, Points and Single Traveler Reservations Only #1

Open
wacheena opened this issue Nov 22, 2017 · 14 comments
Open

Domestic, Points and Single Traveler Reservations Only #1

wacheena opened this issue Nov 22, 2017 · 14 comments

Comments

@wacheena
Copy link
Contributor

FWIW (and to inform other /r/churning visitors) it looks like this project only works with domestic rewards using rapid rewards points for a single traveler.

If I have some time over the holidays I might take a crack at adding support.

@xur17
Copy link
Owner

xur17 commented Nov 22, 2017 via email

@joshjohanning
Copy link

Does anyone have any idea why international fares aren't supported?

@hildebrau
Copy link
Contributor

hildebrau commented Sep 3, 2018

I have a domestic fare with two travellers booked with points and it keeps telling me of a point reduction. However when I look, the price hasn't changed. A few times it had lowered though. But then it has alerted each time since without it lowering further.

How do we debug this container's script? I can't figure out how to run the container without it executing and exiting very fast. I'd like to shell into it and monitor it's execution in debug mode or something.

Is what I'm experiencing the known issue of multiple travelers? I also have some bookings with companion pass travelers applied. Maybe I can help with that issue, too, if it's really a problem. It must error silently, if it is erring.

Thanks!

@hildebrau
Copy link
Contributor

I have a single traveler confirmation number using points. I had a companion attached to it and it was telling me of a price drop for 5354 points. I removed the companion and checked and saw that there was, in fact, NO price drop (or raise). I ran the script again while the companion was not attached and it said the exact same thing bout the 5354 point drop.

It's highly annoying to get this false information alerted to me each time this scheduled script runs. How can we debug the issue? I'd love to step through the script in some way to help make this a more solid alert mechanism.

Thank you!

@joshjohanning
Copy link

joshjohanning commented Dec 5, 2018

@hildebrau And this isn't a sold out flight or anything, right? The only time I got a price drop email mistakenly was when the flight gets sold out. I submit my logic for handling of a sold out flight in PR here: #11

If you know a little bit of python, you can access the Docker container files directly. For example, on my ubuntu machine this is located here:
/var/lib/docker/overlay2/4eff11ff0a7a1b560055bdeefb87bb8a38211511f7a98e12c185bc11ad9db7ce/diff/app/southwestalerts

You will have to do some digging on the exact guid for your instance. Good luck and report back.

@hildebrau
Copy link
Contributor

Thanks. I'll check out the Python code.

And no, it's not sold out.

@hildebrau
Copy link
Contributor

Unfortunately, all I can find in there are .pyc files, which I assume are compiled python code.

@hildebrau
Copy link
Contributor

I did a git clone of the repo, and ran it manually outside of the container to debug.

I added a couple of logging lines:
logging.info('original price: %s',itinerary_price)

            logging.info('current detected price: %s',matching_flight['fares'][0]['price'])

When I run it, it shows this:

INFO:root:original price: 22027
INFO:root:current detected price: {u'amount': u'16,673', u'currencyCode': u'PTS', u'currencySymbol': None}
INFO:root:current detected price: None
sold out
INFO:root:Price drop of 5354 points detected for flight

So, it looks like it could be related to the "sold out" code.

In another instance, it output this:
INFO:root:original price: 23147
INFO:root:current detected price: {u'amount': u'6,603', u'currencyCode': u'PTS', u'currencySymbol': None}
INFO:root:current detected price: {u'amount': u'11,320', u'currencyCode': u'PTS', u'currencySymbol': None}
INFO:root:Price drop of 5224 points detected for flight REMOVED from CLT to AUS on 2019-02-18
INFO:root:Sending email for price drop

The itinerary included AUS->CLT->AUS. However it was reporting the drop on the CLT->AUS leg. This was confusing, as the drop was actually on the AUS->CLT leg. Once I realized that, I was able to save 5224 points; so that was nice.

@hildebrau
Copy link
Contributor

hildebrau commented Dec 12, 2018

Well, I took a stab at this. I'm not really a developer; and never coded in Python before; but I think I did an alright job at this. Sadly, I haven't mastered "git" to pull/push in order to submit my changes. I will try to figure that out.

Here. Maybe I figured it out:
#13

@joshjohanning
Copy link

joshjohanning commented Dec 12, 2018

For the Docker thing, maybe you just have the wrong folder b/c I have my .py files in there. But yeah running manually also works.

Ohh, so what you're saying is a particular class is sold out, but not the entire flight.

I also made changes regarding better handling of the sold out stuff, but not for your particular scenario. If your code works as expected I can scrap this PR then:
#11

Unfortunately I just took my sold out flight over this past weekend so I no longer have a good test case.

I pulled in your code manually to my environment and it seems functional, I just don't have a good test case for it at the moment.

@hildebrau
Copy link
Contributor

How did you pull in my code to your docker container? I use docker-compose.yml files to build my containers locally. I can't figure out how to tell it to use my change, though. Silly me.

@hildebrau
Copy link
Contributor

I believe that an entirely sold out flight will probably not work out with my code changes. I'll have to think about that more. My version will currently handle a fare type being sold out, though.

@joshjohanning
Copy link

joshjohanning commented Dec 12, 2018

I must have had better luck in finding my docker container files than you did :s Perhaps you can run a search under here for *.py files? /var/lib/docker/overlay2/

I only ever had one flight that was completely sold out, but this is what I did (the part I changed is in the if/elif. The elif check is in the current code in master branch, but not the if.

                # Find that the flight that matches the purchased flight
                matching_flight = next(f for f in available['flightShoppingPage']['outboundPage']['cards'] if f['departureTime'] == departure_time and f['arrivalTime'] == arrival_time)
                # Check to make sure the flight isnt sold out to avoid NoneType object is not subscriptable error
                if matching_flight['fares'] is None:
                    print("sold out")
                    matching_flight_price = 0
                elif matching_flight['fares'][0]['price'] is None:
                    print("sold out")
                    matching_flight_price = 0
                else:
                    matching_flight_price = locale.atoi(matching_flight['fares'][0]['price']['amount'])

@xur17
Copy link
Owner

xur17 commented Dec 21, 2018

FYI - if you are trying to modify some of the py files associated with the docker image, I recommend building an image locally rather than trying to modify the existing image locally.

If you have docker installed you just need to clone this repository, and run the following in the cloned directory after modifying any files you wish to modify:

docker build -t my-southwest-alerts .

Then just run the docker run command with the image name you specified above (my-southwest-alerts in this case):

docker run -e MAILGUN_DOMAIN=??? -e MAILGUN_API_KEY=??? -e USERNAME1=SOUTHWEST_USERNAME -e PASSWORD1=SOUTHWEST_PASSWORD -e EMAIL1=NOTIFICATION_EMAIL my-southwest-alerts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants