• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Write a wrapper for these sodding Mixing Deck train things

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Write a wrapper for these sodding Mixing Deck train things

    Most of the train operators seem to use very similar "mixing deck" tools to show you trains and prices - so much so I imagine they are using a turnkey solution or something along those lines.

    They're generally useful if you want a specific train/day but for scouting a range of dates to find the best prices when you're flexible it's a PITA especially that when you change the from/to date, it reloads both from/return panels every time.

    I wonder if there is an API I could query to get all this data upfront and then page through as I see fit, instead of having to do page reloads all the time. Anyone know anything about it?
    Originally posted by MaryPoppins
    I'd still not breastfeed a nazi
    Originally posted by vetran
    Urine is quite nourishing

    #2
    Surely it's just Ajax calls. Just run developer tools in your browser and slurp the queries
    merely at clientco for the entertainment

    Comment


      #3
      I'm not a web-dev although I know enough to understand that However in the past when I've tried to do that sort of thing, it hasn't worked (maybe due to cookies or something as simple as using POST rather than GET might fox me!)

      A more robust solution would be preferred, I can do some digging but initially wondered if anyone else had ever looked into this - maybe nobody else finds it annoying like I do!
      Originally posted by MaryPoppins
      I'd still not breastfeed a nazi
      Originally posted by vetran
      Urine is quite nourishing

      Comment


        #4
        Originally posted by d000hg View Post
        I'm not a web-dev although I know enough to understand that However in the past when I've tried to do that sort of thing, it hasn't worked (maybe due to cookies or something as simple as using POST rather than GET might fox me!)

        A more robust solution would be preferred, I can do some digging but initially wondered if anyone else had ever looked into this - maybe nobody else finds it annoying like I do!
        The backend is a cobbled together system now managed by atos....
        merely at clientco for the entertainment

        Comment


          #5
          Have in the past used URL2FILE, crude but simple. You just need to list the URLs you want to download in a .bat file. That assumes you know the URL names but just looked up East Grinstead to Victoria today at 19.45 and the URL is the site name plus:

          /service/timesandfares/EGR/VIC/today/1945/dep

          You can find a list of station abreviations here: National Rail Enquiries - Station Codes so looks easy enough to figure out.

          PS Aagh! Does not seem to be any wildcard feature in URL2FILW, so specifying time could be problem. Seems wget does though not tried it.
          http://gnuwin32.sourceforge.net/packages/wget.htm
          Last edited by xoggoth; 6 June 2016, 18:53.
          bloggoth

          If everything isn't black and white, I say, 'Why the hell not?'
          John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

          Comment


            #6
            Interesting. The one I most problems with is the GWR sleeper service to Penzance - only one train a day is a sleeper and you have to delve in to see what the sleeper prices are not just the regular ones. It's typically quite pricey so planning a trip around cheap tickets is good, but it takes flipping ages.

            If I could build a "find me the sleeper train prices every day this week" thingie it would be very handy.
            Originally posted by MaryPoppins
            I'd still not breastfeed a nazi
            Originally posted by vetran
            Urine is quite nourishing

            Comment


              #7
              They predominantly use the National Rail Enquiries API (National Rail Enquiries - Developers) as far as I'm aware, though How a student used open data to beat national rail enquiries at its own game | News | The Guardian may be of interest.

              EDIT: although that 2012 story talks of NRE charging for their API, it looks like much of it is now available free for reasonable levels of consumption, judging by pages like National Rail Enquiries - Darwin Data Feeds
              Last edited by NickFitz; 7 June 2016, 19:43.

              Comment

              Working...
              X