Smartgambler
Pro-Punter

Go Back   OZmium Sports Betting and Horse Racing Forums > Public Forums > General Topics
User Name
Password
Register FAQ Search Today's Posts Mark all topics as read

To advertise on these
forums, e-mail us.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21st May 2014, 11:07 AM
Rinconpaul Rinconpaul is offline
Banned
 
Join Date: Feb 2013
Posts: 755
Default Help on XML feed

Can anyone help me with getting the live feed from Tatts into an excel spreadsheet. I've tried Tatts help page but keep getting an error. I've tried many times over the past 12 months but always the same story. I have Excel 2010.

Thanks
Reply With Quote
  #2  
Old 21st May 2014, 11:46 AM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

Most of my work has been designed around web queries but if you are after updating prices XML would be better, i have done some work in the past with this, have you copied the sample in to excel and just played with the code to get the information needed.?
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote
  #3  
Old 21st May 2014, 12:11 PM
Rinconpaul Rinconpaul is offline
Banned
 
Join Date: Feb 2013
Posts: 755
Default

Just get this error massage Shaun. I put todays date in the script to copy.
Attached Images
File Type: jpg excel error.JPG (14.8 KB, 553 views)
Reply With Quote
  #4  
Old 21st May 2014, 12:21 PM
Rinconpaul Rinconpaul is offline
Banned
 
Join Date: Feb 2013
Posts: 755
Default

Hang on Shaun, I had VR4 not MR4, so I fixed that but now all I get is Saddelcloth no. Horse name, wght & Jockey....no prices. Must be getting warmer, hey?
Attached Images
File Type: jpg MR4.JPG (27.9 KB, 570 views)
Reply With Quote
  #5  
Old 21st May 2014, 12:38 PM
evajb001 evajb001 is offline
Member
 
Join Date: Oct 2009
Posts: 463
Default

I don't have a working version of this so just going by looking at the example but I'm assuming its because your using the example which only pulls in those 4 areas by using:

Set runnerNumber = runner.Attributes.getNamedItem("RunnerNo")
Set runnerName = runner.Attributes.getNamedItem("RunnerName")
Set runnerWeight = runner.Attributes.getNamedItem("Weight")
Set riderName = runner.Attributes.getNamedItem("Rider")

So Shaun can correct me but i'm guessing you'd have to add something like:

Set runnerOdds = winodds.Attributes.getNamedItem("Lastodds")

and then to have this show in excel add something this as well:

If Not runnerOdds Is Nothing Then
Sheet1.Cells(i + 1, 5) = runnerOdds.Text
End If


EDIT: By the way I don't use this at all but thought i'd check it out as i'm into website coding and this whole datafeeds stuff. Give the above a try, Shaun might be able to correct it though if i've missed something?

2nd EDIT: Actually in the attributes part "Lastodds" will bring in the last fluc i think, might have to have this as just "Odds"

Last edited by evajb001 : 21st May 2014 at 12:42 PM.
Reply With Quote
  #6  
Old 21st May 2014, 01:18 PM
Rinconpaul Rinconpaul is offline
Banned
 
Join Date: Feb 2013
Posts: 755
Default

Some error here Josh, debug report below. Greedy as I am...l, assuming we can overcome this bug, how could you get all races displayed?
Attached Images
File Type: jpg Debug.JPG (41.9 KB, 552 views)
Reply With Quote
  #7  
Old 21st May 2014, 01:22 PM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

You are correct, you need to add in the extra code and make changes.

This page https://tatts.com/tattsbet_help/info/xml-feed lists all the XML feed pages and if you open a feed you will be able to see what's needed, am kinda busy right now but after todays races i can knock up a sheet that will list the extra items, been awhile since i looked at this myself
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote
  #8  
Old 21st May 2014, 01:46 PM
evajb001 evajb001 is offline
Member
 
Join Date: Oct 2009
Posts: 463
Default

RCP I think it has something to do with the following section needing to be set up for the Winodds part:

Set runnerList = xmldoc.selectNodes("//Runner")

Sheet1.Cells.Clear

For i = 0 To (runnerList.Length - 1)

Set runner = runnerList.Item(i)

I'd have to fiddle with the code later on as about to go to work. But i'd suggest its this section that also needs to be fiddled with to account for the Winodds addition.
Reply With Quote
  #9  
Old 21st May 2014, 01:52 PM
Rinconpaul Rinconpaul is offline
Banned
 
Join Date: Feb 2013
Posts: 755
Wink

Cheers to both Josh and Shaun, It'll have to wait till after the races now as very busy too, good day so far, hope yours is to?
Reply With Quote
  #10  
Old 21st May 2014, 05:07 PM
evajb001 evajb001 is offline
Member
 
Join Date: Oct 2009
Posts: 463
Default

RCP after a bit of stuffing around to get it to initially work give this a try:

Sub LoadRaceField()

Dim xmldoc As MSXML2.DOMDocument

Set xmldoc = New MSXML2.DOMDocument

xmldoc.async = False
xmldoc.Load ("http://tatts.com/pagedata/racing/2014/5/21/SR7.xml")

If (xmldoc.parseError.errorCode <> 0) Then
MsgBox ("An error has occurred: " & xmldoc.parseError.reason)
Else
Set runnerList = xmldoc.selectNodes("//Runner")
Set oddsList = xmldoc.selectNodes("//WinOdds")

Sheet1.Cells.Clear

For i = 0 To (runnerList.Length - 1)

Set Runner = runnerList.Item(i)
Set winodds = oddsList.Item(i)

Set runnerNumber = Runner.Attributes.getNamedItem("RunnerNo")
Set runnerName = Runner.Attributes.getNamedItem("RunnerName")
Set runnerWeight = Runner.Attributes.getNamedItem("Weight")
Set riderName = Runner.Attributes.getNamedItem("Rider")
Set runnerOdds = winodds.Attributes.getNamedItem("Odds")


If Not runnerNumber Is Nothing Then
Sheet1.Cells(i + 1, 1) = runnerNumber.Text
End If

If Not runnerName Is Nothing Then
Sheet1.Cells(i + 1, 2) = runnerName.Text
End If

If Not runnerWeight Is Nothing Then
Sheet1.Cells(i + 1, 3) = runnerWeight.Text
End If

If Not riderName Is Nothing Then
Sheet1.Cells(i + 1, 4) = riderName.Text
End If

If Not runnerOdds Is Nothing Then
Sheet1.Cells(i + 1, 5) = runnerOdds.Text
End If

Next
End If

End Sub
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump



All times are GMT +10. The time now is 05:09 PM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2008 OZmium Pty. Ltd. All rights reserved . ACN 091184655