OZmium Sports Betting and Horse Racing Forums

OZmium Sports Betting and Horse Racing Forums (http://forums.ozmium.com.au/index.php)
-   General Topics (http://forums.ozmium.com.au/forumdisplay.php?f=59)
-   -   'Old' TAB Live Odds Web Service has ended + VBA Issue (http://forums.ozmium.com.au/showthread.php?t=25728)

lomaca 23rd December 2012 12:11 PM

Quote:
Originally Posted by stugots
Well whatever the reasons, they didn't think this through well at all - with all the recent controversies racing has had to deal with & now we have these websites...,

Goose & Golden Egg anyone?
I think the previous poster hit on the real reason, just fired up my tablet and I was ready to bet in less then 5 seconds NO..... kidding!

And it's only a small Android device running at a fraction of the speed of the main computer AND on a WIRELESS connection!
How'z that?

stugots 23rd December 2012 12:23 PM

Just had a laugh to myself at all the future 12 year old's using their phones to hack into dad's tab account for a bit of fun, gotta love those mobile apps.

Shaun 23rd December 2012 03:45 PM

Most companies have the sense to design 2 types of sites, one for pc use and the other for mobile.

I guess the TAB are trying to save a buck.

moeee 23rd December 2012 07:08 PM

Dat new website da TAB got dare - Him pretty Flash Bro.

Neurokahuna 23rd December 2012 10:42 PM

Found a way
 
OK,

After wasting 4 frustrating days playing with Excel I finally worked it out. The secret ingredient was Excel's 'XML Maps'. I wish I found these things a long, long time ago.

If you know how to download the Raceday.xml file from the tatts.com site and save it to your local drive, you can kinda work it out from there (see the Excel example on the tatts.com site for more information, http://tatts.com/tattsbet_help/info/xml-excel-example)

What I did......
1) In cell A1 of Sheet 1, I entered '23/12/2012'
2) In cell A2 of Sheet 1, I entered this formula =text(a1,"YYYY/M/D")
3) In VBA Editor, I entered this code in the appropriate section of the macro.

'Example
'This is where the correctly formatted date is stored in Sheet1
RaceDate = Worksheets("Sheet1").Range("A2").Value

'This is the code that requests the xml file for the date displayed in cell A2
xmldoc.Load ("http://tatts.com/pagedata/racing/" & RaceDate & "/RaceDay.xml")

'Sample file response
'http://tatts.com/pagedata/racing/2012/12/23/RaceDay.xml

'This is the code to save it to your C:\Drive
xmldoc.Save ("C:\Raceday.xml")

If you then follow this well-explained tutorial for creating and using XML Maps, you should be right.

http://www.jkp-ads.com/articles/xmlandexcel05.asp

The xml elements in the Raceday.xml file that I found most useful for creating a race schedule were:
-MeetingCode
-RaceTime
-RaceNo
-VenueName
-MeetingType

NOTE: You only need to do this once. When you change the date in Sheet 1, you right click on the XML Map, and select 'XML > Refresh XML data' from the options and it will update the race list accordingly. I've tried it on a few Saturdays going back and it works well.


I hope I've explained this adequately. I will endeavour over the next few days to get a sample file up on here for people to play with...it won't be elegant like Shaun's code, but it will enough to get ya started and to help y'all stick it right up tab.com.au :-)

Lord Greystoke 24th December 2012 07:06 AM

Brilliant effort NeuroK - must be the 'specialist' on this here, now.

Cheers LG

PS love the handle mate.. sounds like you have bagged some billy big nut$ big uns using the Ns

Shaun 24th December 2012 09:12 AM

It is easy enough to get what you need from the Unitab site, but using this method is it fast enough.

Neurokahuna 24th December 2012 10:53 AM

Hopefully this will help.
 
1 Attachment(s)
OK.....Here is an updated copy of my simple spreadsheet that grabs each race from the Tatts'com xml feed. It uses those XML Maps I was talking about.

Note: If you are using Windows 7, it may not allow you to save a file to the C:\Drive. Just go into the VBA macro 'LoadMeetings' and change the reference for xmldoc.Save to the correct drive (i.e. xmldoc.Save("D:\RaceDay.xml").

Then go into the Schedule worksheet and right click on the XML Map and change the source to where RaceDay.xml is now being saved

Test Run
Seems to work fine on Excel 2010. I like the way it now includes Greyhounds and Trots by default. If you want only certain tracks or race Types, just go to the Schedule worksheet & use 'Clear Contents' to remove the unwanted races. Do NOT use Delete Rows as it will screw up the references in the Review worksheet.

Have a play with and let me know if you find any issues and I will do my best to rectify them. I have already set it up for 24/12/2012, but try changing the date and observe what happens to the race list. It is pretty fast now too. :-)

Shaun 24th December 2012 01:51 PM

I am impressed, i have not had a lot to do with getting data this way but i like what i see and the speed is perfect.

Do you have an account with them and if so are you able to get other form info like this?

There was a time when there past form was available with out an account but that changed with the new site.

Neurokahuna 24th December 2012 05:33 PM

Hi Shaun,

Thanks for the comments. I do have an account with them and can see the extra form info that you mentioned, which I get using a standard Web Query when I am logged in to the site. Otherwise, it just throws an error message and blank data.

Unfortunately, tatts.com don't have an xml feed for that info....yet. I reckon it is because it is 'behind closed doors', so to speak and that is why it isn't made public. Here is a sample I got jsut by clicking on a horse in today's race at Tamworth and I wasn't even logged in. http://tatts.com/racing/formguide.a...ing=NR&race=1#2. use a bit of smarts and you may be able to pull it off their site without even logging in....Might have a tinker with that on Xmas Day.

Having said that, I have a more advanced version of this file that uses some clever logic derived from the existing xml feeds to determine the winners in races, which is quite easy, but it is still a 'work-in-progress' for those damned elusive but appealing trifectas. :-)

Merry Xmas all.


All times are GMT +10. The time now is 03:20 AM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.