Go Back  FlyerTalk Forums > Travel&Dining > Travel Tools
Reload this Page >

Flightplan: How to search a year of award inventory [no longer maintained]

Community
Wiki Posts
Search
Old Jan 16, 2019, 4:04 pm
FlyerTalk Forums Expert How-Tos and Guides
Last edit by: IBobi
Print Wikipost

Flightplan: How to search a year of award inventory [no longer maintained]

Thread Tools
 
Search this Thread
 
Old Jul 9, 2018, 12:39 am
  #16  
 
Join Date: Oct 2013
Posts: 289
Originally Posted by finiteyoda
Now try running "python --version" and "where python" and let me know what you get. I'll also try installing on my Windows laptop, so I can follow along and help debug it better. What version of Windows are you running, btw?
C:\WINDOWS\system32>python --version
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>where python
INFO: Could not find files for the given pattern(s).

I running Win 10
rickywk is offline  
Old Jul 9, 2018, 12:54 am
  #17  
 
Join Date: Jan 2018
Programs: JMB Sapphire, OneWorld Sapphire
Posts: 114
Originally Posted by finiteyoda
Currently, the parser only returns direct non-partner awards. I'd love to get more feedback on how useful the non-direct and partner flights are. I know for myself, I always plan out my trips by searching segment by segment, and I don't fully trust partner awards (because the airlines don't always release all awards to their partners). So, when I search awards, I always go to the source (i.e. if searching SQ awards, I go to the KrisFlyer website).

So, it wouldn't be hard to modify the parser to return the additional data, I'd just like to get a better sense of how people would use it, before tackling it.
I see. I'd like to try this. Should I create a new account? Its quite scary to use active account.
abielp is offline  
Old Jul 9, 2018, 12:59 am
  #18  
 
Join Date: Oct 2013
Posts: 289
Is it more easily to install on MacOS? I using MBP in my home, can have a try later on
rickywk is offline  
Old Jul 9, 2018, 1:30 am
  #19  
Original Poster
 
Join Date: Jan 2010
Posts: 189
Originally Posted by abielp
I see. I'd like to try this. Should I create a new account? Its quite scary to use active account.
I'd recommend creating burner accounts. What you're doing is technically against their TOS, so who knows what kind of action they might take against you. The only reason to use your own account is if you have status that makes more awards available, and even though I don't think I'd risk it.

Originally Posted by rickywk
Is it more easily to install on MacOS? I using MBP in my home, can have a try later on
Installing on both Mac and Ubuntu is pretty easy. For Mac, basically just "brew update && brew install node yarn" and you're good to go. If you didn't have brew installed already, that's like a one-liner. Ubuntu's even easier, just use apt-get. I'm installing on my Windows laptop now, so will hopefully figure out your issue soon though.
jd20 is offline  
Old Jul 9, 2018, 3:17 am
  #20  
Original Poster
 
Join Date: Jan 2010
Posts: 189
rickwyk, I figured out the WIndows issue. The command you need to run is: npm install --add-python-to-path --global --production windows-build-tools

Then restart your computer, run "yarn cache clean" (not sure if this is necessary, but just in case), and then run "yarn global add flightplan-tool". This worked for me on Win10. I've updated the README, so other Windows users don't get stuck.

Last edited by jd20; Jul 9, 2018 at 4:36 am Reason: Update with Windows fix
jd20 is offline  
Old Jul 9, 2018, 6:17 am
  #21  
 
Join Date: Oct 2013
Posts: 289
Originally Posted by finiteyoda
rickwyk, I figured out the WIndows issue. The command you need to run is: npm install --add-python-to-path --global --production windows-build-tools

Then restart your computer, run "yarn cache clean" (not sure if this is necessary, but just in case), and then run "yarn global add flightplan-tool". This worked for me on Win10. I've updated the README, so other Windows users don't get stuck.
The installation command seems ok, but I still cannot run the flightplan command

Microsoft Windows [Version 10.0.17134.112]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>yarn cache clean
yarn cache v1.7.0
success Cleared cache.
Done in 1.72s.

C:\WINDOWS\system32>yarn global add flightplan-tool
yarn global v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- flightplan
Done in 75.19s.

C:\WINDOWS\system32>flightplan
'flightplan' is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>
rickywk is offline  
Old Jul 9, 2018, 6:20 am
  #22  
 
Join Date: Oct 2013
Posts: 289
Originally Posted by finiteyoda
I'd recommend creating burner accounts. What you're doing is technically against their TOS, so who knows what kind of action they might take against you. The only reason to use your own account is if you have status that makes more awards available, and even though I don't think I'd risk it.



Installing on both Mac and Ubuntu is pretty easy. For Mac, basically just "brew update && brew install node yarn" and you're good to go. If you didn't have brew installed already, that's like a one-liner. Ubuntu's even easier, just use apt-get. I'm installing on my Windows laptop now, so will hopefully figure out your issue soon though.
Mac requires Xcode to install?
My mac doesn't have brew command
rickywk is offline  
Old Jul 9, 2018, 6:31 am
  #23  
Original Poster
 
Join Date: Jan 2010
Posts: 189
Originally Posted by rickywk
C:\WINDOWS\system32>flightplan
'flightplan' is not recognized as an internal or external command,
operable program or batch file.
I ran into the same error, took me several rounds of uninstall / reinstall the flightplan-tool module, before it finally worked correctly. I think the reason was because of the initial failed install. Try this:

yarn global remove flightplan-tool
yarn cache clean
yarn global add --verbose flightplan-tool

Look carefully in the output of the last command for any errors, then run "yarn bin". This shows you the directory where the flightplan command is installed. If that directory is empty, it didn't get installed right. If you see a file "flightplan" in that directory, then your PATH variable is messed up (when I used the installer from yarnpkg.com, my PATH was set ok, though I've seen some people report problems).

Originally Posted by rickywk
Mac requires Xcode to install?
My mac doesn't have brew command
I'd imagine Xcode is required (in order to build native code). MacOS instructions for installing homebrew, Xcode, and node are linked from the README: How to Install Node.js and NPM on a Mac. Installing yarn is just a one-liner: "brew install yarn". Once you've installed node / yarn, the screencast video linked in the first post shows you how to run the rest. (I've also updated the README with basic commands to run, to do a search, parse award fares, and run the web UI.)
jd20 is offline  
Old Jul 9, 2018, 6:59 am
  #24  
 
Join Date: Oct 2013
Posts: 289
Originally Posted by finiteyoda
I ran into the same error, took me several rounds of uninstall / reinstall the flightplan-tool module, before it finally worked correctly. I think the reason was because of the initial failed install. Try this:

yarn global remove flightplan-tool
yarn cache clean
yarn global add --verbose flightplan-tool

Look carefully in the output of the last command for any errors, then run "yarn bin". This shows you the directory where the flightplan command is installed. If that directory is empty, it didn't get installed right. If you see a file "flightplan" in that directory, then your PATH variable is messed up (when I used the installer from yarnpkg.com, my PATH was set ok, though I've seen some people report problems).
Let's focus on Win version first.
I got following error now:

c:\Users\xxxx\AppData\Local\Yarn\bin>flightplan server
Opening database...
Error: SQLITE_CANTOPEN: unable to open database file

c:\Users\xxxx\AppData\Local\Yarn\bin>flightplan client
yarn run v1.7.0
warning ..\..\package.json: No license field
$ cd client && yarn start
warning ..\..\..\package.json: No license field
$ react-app-rewired start
Starting the development server...

Compiled successfully!

You can now view flightplan in the browser.

Local: http://localhost:3000/
On Your Network: http://10.50.160.132:3000/

Note that the development build is not optimized.
To create a production build, use yarn build.

Proxy error: Could not proxy request /api/config from localhost:3000 to http://localhost:5000/.
See https://nodejs.org/api/errors.html#e..._system_errors for more information (ECONNREFUSED).

Proxy error: Could not proxy request /api/search?fromCity=SFO&toCity=HKG&quantity=1&directio n=roundtrip&startDate=2018-07-10&endDate=2019-07-09&cabin=first from localhost:3000 to http://localhost:5000/.
See https://nodejs.org/api/errors.html#e..._system_errors for more information (ECONNREFUSED).
rickywk is offline  
Old Jul 9, 2018, 9:47 am
  #25  
Original Poster
 
Join Date: Jan 2010
Posts: 189
Looks like things are actually working normally ^ the "unable to open database file" is because there's no database to open... have you run "flightplan search" and "flightplan parse" yet?

The "Proxy error" is the client's way of telling you that the server is not responding (which is because it couldn't find a database). All the other stuff are just warnings, safe to ignore.

Run the search / parse commands, double-check you have something at "db/database.sqlite3", and then restart the client / server commands. Sounds like you're very close!
jd20 is offline  
Old Jul 9, 2018, 10:39 am
  #26  
Original Poster
 
Join Date: Jan 2010
Posts: 189
For those who would just like to play around with the tool (as opposed to running it on their machine), you can now just visit: http://178.128.176.166:3000/. I've only tested in Safari / Chrome, if your browser has issues let me know.

You can try out the following routes, most of which have award results for both first and business:

SFO - HKG
SFO - NRT
SFO - ICN
NRT - HNL
NRT - ICN
ICN - PEK
ICN - PVG
SIN - HKG
SIN - PVG
SIN - ZRH
daft009 likes this.
jd20 is offline  
Old Jul 9, 2018, 5:58 pm
  #27  
 
Join Date: Oct 2013
Posts: 289
Originally Posted by finiteyoda
Looks like things are actually working normally ^ the "unable to open database file" is because there's no database to open... have you run "flightplan search" and "flightplan parse" yet?

The "Proxy error" is the client's way of telling you that the server is not responding (which is because it couldn't find a database). All the other stuff are just warnings, safe to ignore.

Run the search / parse commands, double-check you have something at "db/database.sqlite3", and then restart the client / server commands. Sounds like you're very close!
c:\Users\xxxx\AppData\Local\Yarn\bin\config>flight plan search
Airline website to search (2-letter code)? CX
Departure city (3-letter code)? HKG
Arrival city (3-letter code)? KIX
Desired cabin class (first/business/premium/economy)? business
Start date of search range (YYYY-MM-DD)? 2018-07-10
End date of search range (YYYY-MM-DD)? 2019-07-10
This method can only search from 1 day(s) from today, adjusting start of search range to: 07/11/2018
This method can only search up to 355 day(s) from today, adjusting end of search range to: 06/30/2019
Searching 355 days of award inventory: 07/11/2018 - 06/30/2019

ERROR: Airline website credentials not found at "config/accounts.json"

Would you like to create the file? [Y/n] y

The file has been created, using "config/accounts-example.json" as a template.
Please edit the file, to contain valid account information for the airlines
you're searching.

Where I should put my accounts.json?
I did copied to C:\Users\xxxx\AppData\Local\Yarn\Data\global\node_ modules\flightplan-tool\config but still not go
rickywk is offline  
Old Jul 9, 2018, 7:03 pm
  #28  
 
Join Date: Feb 2016
Location: Bay Area, CA
Programs: Eternal Search for LT Club
Posts: 66
Originally Posted by rickywk
c:\Users\xxxx\AppData\Local\Yarn\bin\config>flight plan search
Airline website to search (2-letter code)? CX
Departure city (3-letter code)? HKG
Arrival city (3-letter code)? KIX
Desired cabin class (first/business/premium/economy)? business
Start date of search range (YYYY-MM-DD)? 2018-07-10
End date of search range (YYYY-MM-DD)? 2019-07-10
This method can only search from 1 day(s) from today, adjusting start of search range to: 07/11/2018
This method can only search up to 355 day(s) from today, adjusting end of search range to: 06/30/2019
Searching 355 days of award inventory: 07/11/2018 - 06/30/2019

ERROR: Airline website credentials not found at "config/accounts.json"

Would you like to create the file? [Y/n] y

The file has been created, using "config/accounts-example.json" as a template.
Please edit the file, to contain valid account information for the airlines
you're searching.

Where I should put my accounts.json?
I did copied to C:\Users\xxxx\AppData\Local\Yarn\Data\global\node_ modules\flightplan-tool\config but still not go
Go to flightplan/config/

In the folder config you should see a file called accounts.json ; open account it with a texteditor of choice and edit username and p/w fields.

If you have Linux or Mac - cd flightplan-tool/config ; nano accounts.json
rtgta is offline  
Old Jul 9, 2018, 7:08 pm
  #29  
 
Join Date: Mar 2007
Posts: 620
This is great! Having created award.flights I was wondering if you've run into issues with sites that use js frameworks that have a shadow DOM (angular 2+, React) and events not firing properly or does Puppeteer+Headless Chrome negate that issue? QFs & ACs pages in particular are a pain.
blahter is offline  
Old Jul 9, 2018, 7:20 pm
  #30  
 
Join Date: Oct 2013
Posts: 289
Seems I got it to start the search with copied the accounts.json to:
C:\Users\User.Name\AppData\Local\Yarn\Cache\v1\npm-flightplan-tool-0.1.8-bf72da10ce992535e37b61cdcab0efb25ea83a68\config

But the chrome cannot login to AM web site due to filled the username with XXXXXXXXXX:
c:\Users\xxxxxx\AppData\Local\Yarn\bin\config>flig htplan search
Airline website to search (2-letter code)? CX
Departure city (3-letter code)? HKG
Arrival city (3-letter code)? KIX
Desired cabin class (first/business/premium/economy)? business
Start date of search range (YYYY-MM-DD)? 2018-07-11
End date of search range (YYYY-MM-DD)? 2019-06-30
Searching 355 days of award inventory: 07/11/2018 - 06/30/2019
CX: Logging in...
CX: 2nd login attempt...
CX: 3rd login attempt...
CX: 4th and final login attempt...

rickywk is offline  


Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.