Hacking KVS

Discussion in 'KVS' started by Scottrick, Sep 1, 2011.  |  Print Topic

  1. Scottrick
    Original Member

    Scottrick Gold Member

    Messages:
    2,586
    Likes Received:
    4,078
    Status Points:
    2,570
    Not exactly hacking per se... but my dad just saw KVS Tool tonight for the first time and thinks it's awesome. As a professional programmer, he wants to tweak it so that it will automate a lot of processes. For example, he hates having to repeat the search manually for every date, so he'd rather create some kind of script that can interact with KVS and tell it to do the same search seven days in a row, and then repeat that same string of searches for a couple alternative airports, and then spit out the results in a single table.

    He's already figured out a little about how the underlying programming is designed, but does anyone have some advice or experience with this that I can pass along to him?
     
  2. milchap
    Original Member

    milchap Gold Member

    Messages:
    27,686
    Likes Received:
    148,144
    Status Points:
    20,020
    There is nothing like going to the source.
    Perhaps your father should have a conversation with KVS who is a member of MP.
     
  3. Wandering Aramean
    Original Member

    Wandering Aramean Gold Member

    Messages:
    28,226
    Likes Received:
    61,778
    Status Points:
    20,020
    Your best bet is probably to just go after the underlying data sources instead. Since that is all KVS is doing I'd say that putting a middle tier of software in between is not going to make anything more efficient. Depending on which of the sources you're going after it isn't all that hard to script them.
     
  4. Scottrick
    Original Member

    Scottrick Gold Member

    Messages:
    2,586
    Likes Received:
    4,078
    Status Points:
    2,570
    He doesn't want to join MP, but that's what told him to do. He is one of those people who's rather dismissive of miles and points.
    He figures KVS has already designed a good way to access those sources like ANA and Aeroplan. Rather than re-invent the wheel, he'd rather co-opt it to make it do something else. He doesn't really have an issue with KVS as it is, only that he wants to make it search multiple dates and airports automatically. I think he knows how to do this already but wants to check if anyone else has done it first.
     
  5. Wandering Aramean
    Original Member

    Wandering Aramean Gold Member

    Messages:
    28,226
    Likes Received:
    61,778
    Status Points:
    20,020
    There isn't an API for it so you're looking at using something like SendKeys or the like to have it run the queries then aggregate and sort the data. At that point I don't see it as much harder to just run the queries directly against the sources, especially if you're already comfortable as a programmer. Maybe I just think it easier because I've already done it, but it wasn't that difficult to figure out.
     
    Scottrick likes this.
  6. Scottrick
    Original Member

    Scottrick Gold Member

    Messages:
    2,586
    Likes Received:
    4,078
    Status Points:
    2,570
    I was not surprised to see you were the second reply to my OP ;)
     
  7. Wandering Aramean
    Original Member

    Wandering Aramean Gold Member

    Messages:
    28,226
    Likes Received:
    61,778
    Status Points:
    20,020
    There's not a ton of activity on MP so there are not many new (non-SMD3 related) threads when I click that link. This happened to be there and I happen to know some answers so I offered them. :cool:

    :p
     
  8. HaveMilesWillTravel
    Original Member

    HaveMilesWillTravel Gold Member

    Messages:
    12,504
    Likes Received:
    20,199
    Status Points:
    16,520
    Do you think that his enhancements are something that other users would be interested as well? If so, maybe suggesting them to the KVS developer might be a good first step.
     
    Scottrick likes this.
  9. adexpert
    Original Member

    adexpert Silver Member

    Messages:
    337
    Likes Received:
    313
    Status Points:
    545
    He could probably glue something together with AutoIT - http://www.autoitscript.com/site/autoit/. It's been around forever, is free, and is also really handy for automating UIs that were never intended to operate unattended.
     
  10. HoKo
    Original Member

    HoKo Silver Member

    Messages:
    64
    Likes Received:
    43
    Status Points:
    220
    Scott, did your father ever figure out how to do this? I'm running months worth of searches by manually putting in dates right now and it's a major PITA

    Hey Seth, just checked your travel tools site but didn't see this functionality. Have you posted it publicly?
     
  11. Wandering Aramean
    Original Member

    Wandering Aramean Gold Member

    Messages:
    28,226
    Likes Received:
    61,778
    Status Points:
    20,020
    Depends on which specific method you're talking about. Some of my tools are the same sources as KVS.
     
  12. Scottrick
    Original Member

    Scottrick Gold Member

    Messages:
    2,586
    Likes Received:
    4,078
    Status Points:
    2,570
    He thought it was cool, but is not nearly as interested in traveling as I am. After he got what he wanted, I think he lost interest because he didn't really foresee when he would use it again. And I have no programming skills beyond my TI-38+. So the short answer is no, but I still think it would be fun to work on. Maybe in a month or two I'll have time to learn a programming language.
     
  13. HoKo
    Original Member

    HoKo Silver Member

    Messages:
    64
    Likes Received:
    43
    Status Points:
    220
    I was referring to being able to do award inventory searches by alliance one month (or one week) at a time instead of having to look at each day one by one.

    Makes sense, good luck if you decide to give it a whirl.
     
  14. Wandering Aramean
    Original Member

    Wandering Aramean Gold Member

    Messages:
    28,226
    Likes Received:
    61,778
    Status Points:
    20,020
    Gotcha...

    Since most of the data sources out there don't really support that functionality natively the process to loop through all the days would be a bit of a pain. I suppose the ANA tool could be set to query for a single flight (non-connecting) over a range of days pretty easily if you wanted to. Personally I stopped bothering with tools to scrape the ANA site as there are many other tools out there doing it and I didn't see much value-add there. Maybe something for a one-wee search might be useful, but it isn't on my radar these days.
     
  15. HoKo
    Original Member

    HoKo Silver Member

    Messages:
    64
    Likes Received:
    43
    Status Points:
    220
    Gotcha, I think I remember AA stating their intentions to make all of their partners available on their website eventually. Do you know/think that the calendar search function that currently exists for AA (and newly added AS) flights will also be available for partners (once they add them)?

    I actually really like AA's site for booking awards just because the calendar search function is so useful to me.
     
  16. techguru
    Original Member

    techguru Silver Member

    Messages:
    321
    Likes Received:
    376
    Status Points:
    520
  17. HaveMilesWillTravel
    Original Member

    HaveMilesWillTravel Gold Member

    Messages:
    12,504
    Likes Received:
    20,199
    Status Points:
    16,520
  18. HoKo
    Original Member

    HoKo Silver Member

    Messages:
    64
    Likes Received:
    43
    Status Points:
    220
    I've heard people discuss Grease Monkey before, but I have never used it. I don't have any sort of programming background, would I be able to figure it out or is it going to be beyond me?
     
  19. HaveMilesWillTravel
    Original Member

    HaveMilesWillTravel Gold Member

    Messages:
    12,504
    Likes Received:
    20,199
    Status Points:
    16,520
    Use an existing script? Yes. Create a new one without any programming background? No.
     
    Scottrick likes this.
  20. Wandering Aramean
    Original Member

    Wandering Aramean Gold Member

    Messages:
    28,226
    Likes Received:
    61,778
    Status Points:
    20,020
    I've created new ones and edited old ones. It isn't too hard, but I'm not sure it would do what you want in this case. GreaseMonkey is great for changing the way a single page appears. It isn't as good for sequentially browsing through multiple pages in a specific order and filling out form fields with user-generated input, at least not how I've seen it used.

    The process for the ANA query, for example, is about 5 pages long as I recall. GreaseMonkey could easily change the display of that final results page from the ANA UI to something that looks more like the - X O results, but it won't do all the navigation for you.
     
  21. billatq

    billatq Silver Member

    Messages:
    20
    Likes Received:
    11
    Status Points:
    150
    Digging up a bit of an old thread here, but I was looking for the data sources and didn't want to have to pay something just to look at packet captures, so I thought I'd share a bit of what I did.

    It's quite easy to extract the binaries from the installer with anything that understands the WISE installer format, and then you can just fire it up with Ida Pro 5.1 and take a look at the string names for the URLs that KVS hits. It's a VB6 application and appears to heavily leverage the MSHTML controls for accessing web pages with interesting data.

    Most of them are in the format of something like "aHttpFareCo" (ATP/FC) or "aHttpsDelta" (Awards/DL). There are a handful of URLs that are obfuscated, e.g. Sabre/DotRes encodes bytes and then does a table lookup instead of just storing a string, but it wouldn't be that hard to work out.

    One thing that is remarkable to me about the KVS tool is simply how much work it must have been to find all of those URLs and maintain the code for extracting the relevant data out of each page.
     
    Orlan, Justin Johnson and irrawaddy like this.

Share This Page