API-NG For Delphi Calling all Delphi developers.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bnl
    Junior Member
    • Nov 2012
    • 108

    #16
    Originally posted by OzPunter View Post
    We’ll see if other high level languages run into a similar problem later.
    Using Ada, I have not have had any trouble retrieving
    the ssoid, the way I showed in an earlier post.

    Your problems might be caused by :
    * your web client (browser) not returning correctly encoded strings
    * Delphi underlaying routines for decoding whatever format the
    web client returns
    * Operating system related stuff. I run on Debian which is UTF-8 by default (at least for cmd line apps. I only run daemons)


    Having said that, I had no problems using python either
    (which I did for a very short while) also on Debian.

    Actually, I have not seen anyone else here, no matter
    language, having trouble _decoding_ the ssoid.
    I've seen lots of other login related trouble though.

    Don't know if it helps or not .

    /Björn

    Comment

    • OzPunter
      Junior Member
      • Apr 2009
      • 161

      #17
      Originally posted by betdynamics View Post
      The short answer is no - I don't think there is an easy way to get the gallops only races.

      The textQuery seems to be very hit and miss to me (it works on the work "Place" but not on other things!).

      For your particular query, I'm not sure that you want to be looking at the Event information to find out if the race is gallops - instead look at the MarketCatalogue as the Pace, Trot, etc information is held in the marketName (I think).

      However, I think you will still have to load all relevant markets and then discard those that you are not interested in.

      [Edit]
      Ah - our posts crossed. Glad to see that you have managed to get the list that you require. The new API is definitely funky but once you get used to it, it seems to be quite reasonable. There are still some things that I would like to see added and some things made easier, but the transition is not too bad.

      I agree BetDynamics,

      As every developer knows when you have code that either won’t compile or doesn’t produce the expected results one tends to get frustrated. Many throw in the towel and give up but that certainly guarantees failure.

      So through trial and error and persistence, finally results are achieved.

      The thing I find frustrating is that the values for the required variables are not all that clear and only through trial and error and tracking results seems to be the only way to get up and running.

      The downside of this approach is that one could design a heap of code to get a result where there could be an easier more straightforward function that as completely missed.

      Thank you for your input on the forum it has been most encouraging and helpful.

      Somehow I recall similar frustrations with the old API, so like you say, once I get on top of the new API I won’t look back. As always I’ll help as many other Delphi developers as I can, but right now its blind leading the blind.

      Kind Regards
      OzPunter

      Comment

      • OzPunter
        Junior Member
        • Apr 2009
        • 161

        #18
        Originally posted by bnl View Post
        Using Ada, I have not have had any trouble retrieving
        the ssoid, the way I showed in an earlier post.

        Your problems might be caused by :
        * your web client (browser) not returning correctly encoded strings
        * Delphi underlaying routines for decoding whatever format the
        web client returns
        * Operating system related stuff. I run on Debian which is UTF-8 by default (at least for cmd line apps. I only run daemons)


        Having said that, I had no problems using python either
        (which I did for a very short while) also on Debian.

        Actually, I have not seen anyone else here, no matter
        language, having trouble _decoding_ the ssoid.
        I've seen lots of other login related trouble though.

        Don't know if it helps or not .

        /Björn
        Dear BNL,

        Thank you for your input...

        I also noticed that there weren’t any posts from other languages having trouble with decoding the session token. This fact kept pushing me back to my code and made me did deeper to figure out exactly what the problem was.

        The Webbrowser component used in Delphi is not a uniquely Delphi component, it is actually imported from MS-Windows so it is identical to the engine that drives I.E.

        The format of the PostData as a variant (also a MS type) and conversion to a Delphi string is where the problem comes in and from searching the web I wasn’t able to find any code examples that correctly decoded the PostData except for the TIdURI.URLDecode class, which is part of the INDY suite of components, also suppled with Delphi.

        In the evolution of code over the years variable types have changed and along with these changes various components have changed as well.

        I believe that through these mismatches of variable types and component versions the problem arose because of a slight oversight in decoding and the compatibility of webbrowsers and decoding classes.

        Therefore I believe that at some time in the future this problem will raise its head again and we’ll all be back experimenting with decoding components again.

        The comment that there are no others reporting this type of problem doesn’t take into account many emails I have received from Delphi developers who haven’t gotten that far as yet.

        Thank you for your comments BNL most appreciated.

        Kind Regards
        OzPunter

        Comment

        • OzPunter
          Junior Member
          • Apr 2009
          • 161

          #19
          Getting Prices

          Spent all day on this one aspect and getting prices is proving to be impossible.

          I can get events,
          I can get the runners,
          and when I try to get prices I get nil!

          I get the id of the runner, the adjustment factor, status etc but
          the oExchangePrices is nil;

          same thing for Orders, Matches and ExchangePrices.

          How exactly are you supposed to get the prices (exchange prices, back and lay and volumes)?

          I don't understand where the problem is, because if I can see the runner and all their variables I should be able to see the prices, right?

          or is the mystery Filter thing need some special setting that I haven't found?

          Kind Regards
          OzPunter

          Comment

          • betdynamics
            Junior Member
            • Sep 2010
            • 534

            #20
            Prices are returned via the listMarketBook call. Within that call, you need to set the priceProjection parameter in order to return current prices.

            The priceProjection parameter can be used to fine-tune the number/type of prices returned.

            For default pricing, set priceProjection as follows:

            priceData to EX_BEST_OFFERS (or EX_ALL_OFFERS)
            exBestOffersOverrides (if you want to change the defaults used for the prices)
            virtualse to true
            rollover to false

            The key to the API is not to send any parameters that you don't want (as long as they are not mandatory parameters). Mandatory parameters are flagged in the documentation.

            Comment

            • OzPunter
              Junior Member
              • Apr 2009
              • 161

              #21
              Originally posted by betdynamics View Post
              Prices are returned via the listMarketBook call. Within that call, you need to set the priceProjection parameter in order to return current prices.

              The priceProjection parameter can be used to fine-tune the number/type of prices returned.

              For default pricing, set priceProjection as follows:

              priceData to EX_BEST_OFFERS (or EX_ALL_OFFERS)
              exBestOffersOverrides (if you want to change the defaults used for the prices)
              virtualse to true
              rollover to false

              The key to the API is not to send any parameters that you don't want (as long as they are not mandatory parameters). Mandatory parameters are flagged in the documentation.
              TThanks BetDynamics you're a great help...

              I actually tried all combinations of those settings and somehow missed the prices..

              When I tried them again I can get prices now.

              I was also confusing Market Catalogue and Market Book so I was probably looking for the info in the wrong place.

              Confusion of course is a by product of the new API… I’m sure I’m not alone.

              Thanks for your help.

              Kind Regards
              OzPunter

              Comment

              • OzPunter
                Junior Member
                • Apr 2009
                • 161

                #22
                Here’s something odd?

                The runners in a race are listed in the Market Catalogue which includes the Runners name, ID etc. The list of runners in Market Catalogue includes the scratchings.

                To work out which runners are scratched you need to look for Removed Runners in the Runner Status in Market Book along with the prices for each runner.

                It seems to me that the Market Book only contains the “Active” runners therefore there are no “Removed” runners shown in Market Book, so if Removed runners don’t appear in Market Book why have the Removed Time and Date?

                Kind Regards
                OzPunter

                Comment

                • OzPunter
                  Junior Member
                  • Apr 2009
                  • 161

                  #23
                  Originally posted by OzPunter View Post
                  The runners in a race are listed in the Market Catalogue which includes the Runners name, ID etc. The list of runners in Market Catalogue includes the scratchings.

                  To work out which runners are scratched you need to look for Removed Runners in the Runner Status in Market Book along with the prices for each runner.

                  It seems to me that the Market Book only contains the “Active” runners therefore there are no “Removed” runners shown in Market Book, so if Removed runners don’t appear in Market Book why have the Removed Time and Date?

                  Kind Regards
                  OzPunter
                  Err Forget that, it's a woopsie.. I wasn't looking at the whole race.. Strangely the race I was looking at has 4 scratchings but the BF website and Market Book only list 2 scratchings.. The other two scratchings don't appear anywhere. They aren't in Market Book or on the website..

                  Comment

                  • OzPunter
                    Junior Member
                    • Apr 2009
                    • 161

                    #24
                    Dare I say it? ---- It works! Yay

                    I hope I’m not speaking too soon but through persistence and the very generous assistance from BetDynamics (Thank You) I now have my program up and running.

                    For all those still struggling I recommend that you import the Example Client Delphi project and study how it works, I don’t think you can get away from the SuperObject easily so just import all the classes into your project and start from scratch.

                    The textQuery variable remains a mystery so set it to a blank string (‘’) and figure it out later, be careful what values you select in the Filter section, some settings seem to conflict with others and make progress slowly.

                    Still having problems, my email is “admin AT ozpunter DOT net” , I’ll help you if I can.

                    Happy chappie now.

                    Kind Regards
                    OzPunter

                    Comment

                    Working...
                    X