clothNumber from metadata

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tippete
    Junior Member
    • Mar 2016
    • 42

    #1

    clothNumber from metadata

    Can anyone enlighten me on getting the clothNumbers in a Datarid along with existing horses name etc.
    I can get the metadata including clothNumber in a TextBox but thats before serialising . Im using the programming for Betfair
    in windowsFormsApp(.NETFRAMEWORK)

    Be much appreciated.

    Peter
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    I'm not certain what the problem is, but I think I can see it, but please tell me if I'm wrong.

    Within the RunnerCatalog for each horse, in the MarketCatalogue data, is this:
    metadata Map<String,String>
    And I don't know what Map<String,String> means.

    At the moment, my VS Studio userid brings up objections when I try to open it because it says my userid has expired. I need to sort this out, but I don't have the time for such messing about right now.

    I'm assuming that deserialising the data returned from a ListMarketCatalogue call does not put data nicely into the RunnerCatalog.metadata data items.

    At present I can't easily retrieve any metadata to look at. It it possible that you could get hold of the metadata for a horse and then paste it in the thread so I can try to work out how you can easliy get the item that you are after? Cheers.

    EDIT

    After further thoughts, I checked the offline API PDF and found two other instances of the use of Map<string, string>. It appears that the data is designed to be loaded into a .NET list item so that all items can be directly referenced, using the data item name as key, if I've understood it correctly.

    This would means you should define the Metadata as a keyed list. It's been a while since I've done this, and with VS Studio currently being difficult, I can't locate an example for you.
    Last edited by jabe; 09-04-2021, 02:10 PM.

    Comment

    • WTPooh
      Member
      • May 2012
      • 88

      #3
      Metadata in terms of .NET Framework is a dictionary <string, string>.
      Here is my definintion of metadata field in the RunnerCatalog class:
      Public metadata As Dictionary(Of String, String)

      Example how to get the clothNumber from metadata:

      Dim clothNumber As String = Nothing
      If runner.metadata.TryGetValue("CLOTH_NUMBER_ALPHA", clothNumber) Then
      '...
      Else
      '...
      End If

      Comment

      • tippete
        Junior Member
        • Mar 2016
        • 42

        #4
        Thanks for the help guys, i've eventually managed to get the cloth numbers . My next task is to get the silk colours.
        i get a code for the colours and i have that prefixed with the url in the datagrid. How do i get the silks from this.

        Regards Pete

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          Originally posted by tippete View Post
          Thanks for the help guys, i've eventually managed to get the cloth numbers . My next task is to get the silk colours.
          i get a code for the colours and i have that prefixed with the url in the datagrid. How do i get the silks from this.

          Regards Pete
          It's just an image file, I think, so it'd be a case of declaring a variable that can hold an image and then loading the image in with the URL. Not sure of the details, but you should be able to find examples on the interweb.

          Comment

          • tippete
            Junior Member
            • Mar 2016
            • 42

            #6
            Thanks Jabe

            ive looked on internet but i cant find any anywhere.

            Comment

            • geoffw123
              Senior Member
              • Mar 2014
              • 250

              #7
              Just go onto the BF website, right click on an image of a jockey silk and copy image link. You then have the URL location where the images are stored.

              Comment

              • WTPooh
                Member
                • May 2012
                • 88

                #8
                Dim image As Image
                Dim request = WebRequest.Create(silkImageLink)
                Using response = request.GetResponse(), stream = response.GetResponseStream()
                image = New Bitmap(stream)
                End Using

                Comment

                • tippete
                  Junior Member
                  • Mar 2016
                  • 42

                  #9
                  Thanks for the help guys. Another step in the right direction .

                  Comment

                  Working...
                  X