ITA-Matrix-PowerTools - Userscript for Orbitz/DL/UA/AA/BA/CZ/IB/LA/LH/LX/TK
|
|||
#1
Original Poster
Join Date: Nov 2012
Location: Minutes from ATL
Programs: DL
Posts: 341
ITA-Matrix-PowerTools - Userscript for Orbitz/DL/UA/AA/BA/CZ/IB/LA/LH/LX/TK
Function:
Scrapes flight info from a ITA/Matrix Itinerary page and creates a clickable link to Orbitz/Cheaptix, United, and Delta for booking.
I've moved the usage information to the thread's wiki.
Scrapes flight info from a ITA/Matrix Itinerary page and creates a clickable link to Orbitz/Cheaptix, United, and Delta for booking.
I've moved the usage information to the thread's wiki.
Last edited by paul21; Nov 11, 14 at 11:02 am
#2
Join Date: Oct 2013
Posts: 529
Awesome script and really cool idea!
However, I cant get it working :/
I tried via tampermonkey and greasemonkey as well as through the console in chrome and firefox.
No link gets created, but maybe its just me being too dumb.
When using the cmd line in the console in chrome, I get the following error:
undefined
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined VM7065:2
In firefox I get:
undefined
TypeError: O is undefined
Another side note: Any chance you could include cheaptickets.com as well? Cheaptickets has exactly the same url structure as orbitz but most of the time it prices it a bit cheaper than orbitz and also gives better results when including many tricked routes, thanks!
However, I cant get it working :/
I tried via tampermonkey and greasemonkey as well as through the console in chrome and firefox.
No link gets created, but maybe its just me being too dumb.
When using the cmd line in the console in chrome, I get the following error:
undefined
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined VM7065:2
In firefox I get:
undefined
TypeError: O is undefined
Another side note: Any chance you could include cheaptickets.com as well? Cheaptickets has exactly the same url structure as orbitz but most of the time it prices it a bit cheaper than orbitz and also gives better results when including many tricked routes, thanks!
#3
Original Poster
Join Date: Nov 2012
Location: Minutes from ATL
Programs: DL
Posts: 341
Awesome script and really cool idea!
However, I cant get it working :/
I tried via tampermonkey and greasemonkey as well as through the console in chrome and firefox.
No link gets created, but maybe its just me being too dumb.
When using the cmd line in the console in chrome, I get the following error:
undefined
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined VM7065:2
In firefox I get:
undefined
TypeError: O is undefined
Another side note: Any chance you could include cheaptickets.com as well? Cheaptickets has exactly the same url structure as orbitz but most of the time it prices it a bit cheaper than orbitz and also gives better results when including many tricked routes, thanks!
However, I cant get it working :/
I tried via tampermonkey and greasemonkey as well as through the console in chrome and firefox.
No link gets created, but maybe its just me being too dumb.
When using the cmd line in the console in chrome, I get the following error:
undefined
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined VM7065:2
In firefox I get:
undefined
TypeError: O is undefined
Another side note: Any chance you could include cheaptickets.com as well? Cheaptickets has exactly the same url structure as orbitz but most of the time it prices it a bit cheaper than orbitz and also gives better results when including many tricked routes, thanks!
What language, pricing, airports were you using? First or econ?
The regexp's I wrote are probably sensitive to some things in the airport names like non-us characters and non dollars.
There's also limits to the number of segments via the different methods...
UA seems to support 9-10
ORB/DL seems to support 7-8
Last edited by paul21; Oct 28, 14 at 11:09 am Reason: Removed code for version control above
#4
Join Date: Jan 2008
Location: KATL
Programs: DL DM/2MM
Posts: 1,958
Hi Paul- Thanks so much for putting this together. I've always wanted to do something like this but your method works better than anything I've come up with so far.
Can I request a fix? The script isn't working with AZ right now due to the dash in the airline name. I manually corrected for myself, but if you want to incorporate into your script the correction I made is:
Was tinkering around with building an array of the image alt tags to help isolate the flight number with more reliability, but the above is an easy fix for at least the AZ problem.
Can I request a fix? The script isn't working with AZ right now due to the dash in the airline name. I manually corrected for myself, but if you want to incorporate into your script the correction I made is:
Code:
var t = /\<td class=\"dijitReset carrier\"\>[A-z\s\.\,\-]*([0-9]+)/g;
#7
Join Date: Jun 2013
Location: Somewhere between if and else
Posts: 142
Nice idea! ^
I did some work and added support for the german version of ita.
Give it a try
You can find it here:
https://gist.github.com/anonymous/59fa19f78289571b9a49
Warning: Github is messing up special-chars like ü & ä in raw mode... what a pity
----- Edit ----
To deal with something like:
Scandinavian Airlines System (SAS) 903
you need
https://gist.github.com/anonymous/9261bd7620a4e246e63f
I did some work and added support for the german version of ita.
Give it a try

Code:
changed var re=/(strong)*\>[A-Za-z\s/\,\.]*\((\w\w\w)\)[^\(]*\((\w\w\w)\)/g; to var re=/(strong)*\>[^\(\>]*\((\w{3})[^\(]*\((\w{3})/g; changed var re=/(strong)*\>[A-Za-z\s\/\,\.]*\(\w\w\w\)[A-Za-z\s\/\,\.]*\(\w\w\w\)\s*\-\s*\w*\,\s*(\w\w\w)\s([0-9]*)/g; to var re=/(strong)*\>[^\(\>]*\(\w{3}[^\(]*\(\w{3}[^\,]*\,\s*([a-zA-Z0-9]{1,3})\.?\s*([a-zA-Z0-9ä]{1,3})/g; and much more...
https://gist.github.com/anonymous/59fa19f78289571b9a49
Warning: Github is messing up special-chars like ü & ä in raw mode... what a pity
----- Edit ----
To deal with something like:
Scandinavian Airlines System (SAS) 903
you need
Code:
//Find Airports var re=/(strong)*\>[^\(\<]*\((\w{3})[^\(\<]*\((\w{3})/g; and //Find Date var re=/(strong)*\>[^\(\>]*\(\w{3}[^\(\<]*\(\w{3}[^\,]*\,\s*([a-zA-Z0-9]{1,3})\.?\s*([a-zA-Z0-9ä]{1,3})/g;
Last edited by Steppo; Nov 1, 14 at 6:43 pm Reason: Github Raw
#8
Join Date: Jun 2013
Location: Somewhere between if and else
Posts: 142
Hopefully Paul21 is still interested and updating this thread. 
I have done some work to bring this script to the next level.
I don't know if you ever encountered the following problem of the calendar view:
You are looking for a special fare, ita throws an error when the searched fare is unavailable for the given month. You have to go back to the search, change the month and search again.
To solve this i added a part to make the datechange form visible and added clickable month foward/backward icons. So you will be able to open the next month with just one click.
As soon as i fixed the issue with raw mode of Github, i will add the installable version for greasemonkey which has to be slightly different.
But for now you may edit the installed version by hand.
I rearranged most of the code structure but hopefully did not destroy something. I played around with some searches and everything worked well.
There is still a lot of work.. so keep going.
To use in console:
https://gist.github.com/anonymous/daaddea2c3b1ad556c8e
To use with greasemonkey:
Replace the current script with this ( But do NOT copy in raw mode!):
https://gist.github.com/anonymous/5d89dc45d588650460e0
Greetings

I have done some work to bring this script to the next level.
2014-11-09 Edited by Steppo (Added monthly navigation to calendar, added retry for details if content is loading slow, added flights as object (see data var ) , added Farefreaks, added GCM)
You are looking for a special fare, ita throws an error when the searched fare is unavailable for the given month. You have to go back to the search, change the month and search again.
To solve this i added a part to make the datechange form visible and added clickable month foward/backward icons. So you will be able to open the next month with just one click.
As soon as i fixed the issue with raw mode of Github, i will add the installable version for greasemonkey which has to be slightly different.
But for now you may edit the installed version by hand.
I rearranged most of the code structure but hopefully did not destroy something. I played around with some searches and everything worked well.
There is still a lot of work.. so keep going.
To use in console:
https://gist.github.com/anonymous/daaddea2c3b1ad556c8e
To use with greasemonkey:
Replace the current script with this ( But do NOT copy in raw mode!):
https://gist.github.com/anonymous/5d89dc45d588650460e0
Greetings

#9
Original Poster
Join Date: Nov 2012
Location: Minutes from ATL
Programs: DL
Posts: 341
Thanks for the additions Steppo!
I've setup a repository here:
https://github.com/paul21ft/ita-matrix-powertools
so you should be able to pull/push changes in a more centralized way.
I've setup a repository here:
https://github.com/paul21ft/ita-matrix-powertools
so you should be able to pull/push changes in a more centralized way.
#11
Join Date: Jun 2013
Location: Somewhere between if and else
Posts: 142
- Open ita-matrix-powertools on github:
https://github.com/paul21ft/ita-matrix-powertools - Choose: ita-matrix-powertools.user.js
- Click on RAW (seems to work now even with special-chars)
- You should be asked whether you want to install this script
- Install and you are done
or just try this link:
https://github.com/paul21ft/ita-matr...rtools.user.js
#12
Join Date: Oct 2013
Location: RDU
Programs: AA PLT, Club Carlson GLD, IHG Spire, Lifemiles GLD, Hilton Gold
Posts: 338
This is an awesome idea. But I can't get it to work.
I have tampermonkey installed and I can see that the DL/ORB Itinary builder script is running. However, no link appears allowing me to book the the itinerary on orbitz.
In console mode, I also get an error. Any ideas what I might be doing wrong?
I have tampermonkey installed and I can see that the DL/ORB Itinary builder script is running. However, no link appears allowing me to book the the itinerary on orbitz.
In console mode, I also get an error. Any ideas what I might be doing wrong?
#13
Join Date: Jun 2013
Location: Somewhere between if and else
Posts: 142
This is an awesome idea. But I can't get it to work.
I have tampermonkey installed and I can see that the DL/ORB Itinary builder script is running. However, no link appears allowing me to book the the itinerary on orbitz.
In console mode, I also get an error. Any ideas what I might be doing wrong?
I have tampermonkey installed and I can see that the DL/ORB Itinary builder script is running. However, no link appears allowing me to book the the itinerary on orbitz.
In console mode, I also get an error. Any ideas what I might be doing wrong?
Post it in public or via PM. As you like!
#14
Join Date: Jul 2013
Location: SZX(HKG), SFO
Programs: UA1K, AAEXP, CZ G, MU PLT, CA PLT, Hyatt D, Hilton D, Marriott PP
Posts: 45
there is a problem for UA, if jump by HPMNK, we will not allow to use TC~
then, to paul21:
The script not work to me, but I am also a programmer, I corrected it.
some advise:
don't specify default value for the parameters of functions liked function x(y=0), maybe it needs very high version of js-engine to run, it did not work here to me.
the other problem here to me is "itaLocale undefined", I can see it is a global variable in the itinerary page, but I don't know why it can't be located in the script here to me, maybe lack of privilege?
then, to paul21:
The script not work to me, but I am also a programmer, I corrected it.
some advise:
don't specify default value for the parameters of functions liked function x(y=0), maybe it needs very high version of js-engine to run, it did not work here to me.
the other problem here to me is "itaLocale undefined", I can see it is a global variable in the itinerary page, but I don't know why it can't be located in the script here to me, maybe lack of privilege?
Last edited by kulin; Nov 10, 14 at 9:20 am
#15
Join Date: Oct 2013
Location: RDU
Programs: AA PLT, Club Carlson GLD, IHG Spire, Lifemiles GLD, Hilton Gold
Posts: 338
screenshots
Would you mind to send me screenshots of your console showing which error you get? Are you sure tampermonkey is executing the script? It should throw at least one error on the resultpage if content could not be found. Can you see the two new links on the calendar-page?
Post it in public or via PM. As you like!
Post it in public or via PM. As you like!

Here are the tampermonkey options. The script is green.

If I click the script it goes red, which I assume means it is no longer running. so I think that part is working.

Here is the calendar screenshot. I'm not sure what links I should see there.

Does that help? Did I miss a step somewhere?
Thanks for your help!