Flightplan: How to search a year of award inventory [no longer maintained]
#46
Original Poster
Join Date: Jan 2010
Posts: 189
#47
Original Poster
Join Date: Jan 2010
Posts: 189
When you run "flightplan server" it runs the back-end server that runs on port 5000 and returns raw data from the database. When you run "flightplan client" it runs the website that you connect to on port 3000. To view the website, you need both running (because client talks to server, it can't read the database directly itself), and you point your web browser to http://localhost:3000.
What's the command line output when you run the client and server commands? Any errors? Make sure your web browser is pointing to localhost:3000, not localhost:5000.
This was a bug in the client command, I fixed and pushed a new version. For any who ran into this issue, run "yarn global upgrade" to get the latest version.
Excellent tools!! I am able to run search however not able to launch the Web UI.
After I input the command "flightplan client", it responds that "C:\\Users\\Steven" doesn't exist.
My user account in windows is "Steven XXXX", guess it was truncated in the script? Do you know how I can fix it? Thanks!
After I input the command "flightplan client", it responds that "C:\\Users\\Steven" doesn't exist.
My user account in windows is "Steven XXXX", guess it was truncated in the script? Do you know how I can fix it? Thanks!
#48
Original Poster
Join Date: Jan 2010
Posts: 189
There's 2 big hurdles to get over with extensions:
- The javascript you can inject is run in a separate context than the page's own js context
- Changing the value on a textbox via jquery/pure js for example doesn't trigger the React onChange event which in turn won't call the function to set the value of the departure airport(QF). Chrome headless may actually simulate a user performing the action so you may not run into this issue.
Yeah, one nice thing with Puppeteer is you can mimic user actions like typing and clicking. You can even insert random delays between key strokes, making it look very human. But it's simpler and more robust to set value directly, when possible. I sometimes have issues with typing in boxes, because a modal pop-up will interrupt the action. Or calendar, trying to page through month by month, and find the right day to click is fare more code than just setting form value directly.
#49
Join Date: Jul 2018
Posts: 6
Every time when I start a new search, the first search will be timed out and that search date will be skipped. Maybe a logout step can be added before the previous search was completed?
Last edited by steven1201; Jul 11, 2018 at 1:00 am Reason: typo
#50
Original Poster
Join Date: Jan 2010
Posts: 189
Which airline are you seeing that with? I think I was seeing a similar thing, but not all the time, it was sporadic (and depended on whether the browser was in headless mode or not). I'll try and repro it further.
The reason I don't do a fresh login on every session, is it can look suspicious to the airline (since normal browsers retain cookies between sessions). Normal human users don't get timeouts on first search in normal Chrome, so I'm sure it's a bug somewhere.
The reason I don't do a fresh login on every session, is it can look suspicious to the airline (since normal browsers retain cookies between sessions). Normal human users don't get timeouts on first search in normal Chrome, so I'm sure it's a bug somewhere.
#51
Join Date: Jul 2018
Posts: 6
Which airline are you seeing that with? I think I was seeing a similar thing, but not all the time, it was sporadic (and depended on whether the browser was in headless mode or not). I'll try and repro it further.
The reason I don't do a fresh login on every session, is it can look suspicious to the airline (since normal browsers retain cookies between sessions). Normal human users don't get timeouts on first search in normal Chrome, so I'm sure it's a bug somewhere.
The reason I don't do a fresh login on every session, is it can look suspicious to the airline (since normal browsers retain cookies between sessions). Normal human users don't get timeouts on first search in normal Chrome, so I'm sure it's a bug somewhere.
Say I search from A to B between 2019-03-16 and 2019-03-20, then I start a new search from C to D between 2019-03-16 and 2019-03-20. The first search of C to D on 2019-03-16 will be skipped due to timeout.
I think it makes sense to logout after finishing all the search from A to B.
#56
Original Poster
Join Date: Jan 2010
Posts: 189
Yes, you can run as many instances of flightplan on the same machine as you like (each one has it's own instance of Chromium running) but there's a few caveats:
- Some airlines (like SQ) do weird things with session management, such that if you try to search from the same account logged onto multiple computers, they will interfere with each other.
- Also some airlines (again, mainly SQ) monitor how many requests come from same IP, and will start blocking that IP address. So, running multiple instances from same computer, you're gonna hit that limit sooner.
#59
Original Poster
Join Date: Jan 2010
Posts: 189
When running multiple instances of flightplan, each instance gets it own complete copy of Chromium (there's nothing being shared between them, other than your IP address). So if CX is working on multiple computers (with same account) it should work on same computer too, unless CX is doing something tricky with monitoring IP addresses. To be safe, I'd use multiple CX accounts if running on same computer (there's a command line option to specify which account to use from accounts.json).
-h shouldn't be really any faster than non-headless mode... Most of the delay is waiting for the airline website to respond (I've seen SQ regularly take about a minute to return award results) and the throttling delay which is inserted between requests (usually like 10-20 seconds).
-h shouldn't be really any faster than non-headless mode... Most of the delay is waiting for the airline website to respond (I've seen SQ regularly take about a minute to return award results) and the throttling delay which is inserted between requests (usually like 10-20 seconds).