Go Back   Sports Handicapping Forum > Welcome Forums > Main Street > Capping

Capping All handicapping, betting systems, spreadsheets, mathematics & quantitative technicapping.

Like Tree1Likes
  • 1 Post By thom321

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-08-2011, 03:07 PM
Registered User
 
Join Date: May 2010
Posts: 11
Rewards: 295
Using Excel to import and filter all Pinnacle lines by sport/league

uva's workbook on grabbing Pinnacle's XML feed with Excel gave me an idea to take this a step further by building a workbook that allows the user to create a table with odds for any sport/league that Pinnacle offers odds for and displaying it in a customized format e.g. depending on the sport or event. My goal was to get a working solution, not the prettiest, and in its current version it works for me at least and maybe it can be useful for someone else.

I wouldn't advice using the code I created as a proper way of writing VBA since my focus was on getting something working quickly. When that failed and the task got infinitely more complicated than I envisioned initially, instead of re-writing much of the code, I added some patches here and there to make it work. Hence, the code is very likely not the most efficient way (I know it isn't) but it works fast enough and is flexible enough for me.

I hadn't worked with XML before and I quickly got tired of trying to parse XML the way I assume it was intended. Instead I am simply looping through all the nodes and dumping the resulting columns of data into an Excel sheet and take if from there since I know I can get the data to dance pretty well once I have it in Excel.

If you decide to have a look at it, I suggest that you first read the sheet called "Instructions" (go figure) since it should tell you most of what you need to know to use the workbook. Actually, it tells you a whole lot more than you need to know but I included the extra info in case some of you felt like actually creating your own customized formatting for how the odds are displayed in the workbook.

Definitely works in Excel 2010, works in my version of Excel 2007 and probably works in Excel 2003. If you encounter any problems in running the macros (after having checked the references i list in the Instructions sheet) please let me know. Also, if it seems to run ok but the data looks incorrect I would definitely like to know. I have tested it a fair bit myself but not on all sports or all leagues so there might be some league specific issues that would prevent the data from displaying properly.
Attached Files
File Type: xlsm Pinnacle XML feed macro.xlsm (1.63 MB, 111 views)
Reply With Quote
Rewards Awarded to thom321 for this Post
Date User Comment Amount
06-16-2011 Dr. Jack good stuff in excel 50
  #2  
Old 06-09-2011, 01:05 AM
Hall of Fame
 
Join Date: Oct 2005
Location: Salem, VA
Posts: 22,450
Rewards: 1,800
This is very nice. I highly suggest everybody download this. Its understandable as well why you want to import the entire XML sheet first, otherwise you would just have to find the node properties for each sport individually. I agree no need to burden yourself with such an exhaustive task.

BTW this is far more organized than what I throw together, though I'm usually only concerned with functionality and not the aesthetic qualities of the coding.
__________________
"Nobody goes there anymore, its too crowded." --Yogi Berra

"Always tell the truth, that way you won't have to remember what you said." --Mark Twain


*=$50,000
Reply With Quote
  #3  
Old 06-10-2011, 12:54 PM
Registered User
 
Join Date: Feb 2009
Location: 604, 310, & 775 via 416
Posts: 1,785
Rewards: 404
K this is awesome thanks

best line "If your computer catches fire after running this workbook, it is not my fault, it is not my fault, in any such event, i suggest getting a new computer"
__________________
hi
Reply With Quote
  #4  
Old 06-16-2011, 12:22 AM
Registered User
 
Join Date: Mar 2011
Posts: 2
Rewards: 25
Hi Thom321,

i tried to run this on my mac, guessed it wouldn't work... trouble is it's screwed up my excel. any ideas about how to restore everything?

sorry for the dumb question.
Reply With Quote
  #5  
Old 06-16-2011, 06:41 AM
Registered User
 
Join Date: May 2010
Posts: 11
Rewards: 295
Sorry, I have never used a Mac so I have no idea what works/doesn't work on it.

I know that the workbook does NOT make any changes to any Excel settings. In Windows, if Excel crashed while running this workbook, which can happen with any workbook, when you restart Excel everything would look the same.

If you want a solution that works for Mac, I advice you to read uva's thread "Grabbing Pinnacle Lines with Excel and DOM" where he shows a php script he created to get odds from Pinnacle.
Reply With Quote
  #6  
Old 06-16-2011, 11:55 PM
Registered User
 
Join Date: Mar 2011
Posts: 2
Rewards: 25
thanks

excel freakin out on my mac lol. not sure wht's done it but it might also have been a site i tried to scrape just B4.

going to run ur scraper on windows <::> yea been checking UVA's thread too.

thanks to both of u

good luck

Last edited by subs; 06-16-2011 at 11:58 PM.
Reply With Quote
  #7  
Old 07-21-2011, 07:29 AM
Registered User
 
Join Date: Jul 2011
Location: Kansas City
Posts: 23
Rewards: 57
New to this site, been on other forums a while. Think I'm going to like it here. That spreadsheet is fantastic. Thanks a bunch.
Reply With Quote
  #8  
Old 12-13-2011, 12:19 PM
Registered User
 
Join Date: Dec 2011
Posts: 3
Rewards: 7
Great Spreadsheet

This is exactly what I needed, Thank You! I do have one question though, I open the worksheet, import the odds and everythign works fine. I then wait 5 minutes re-import the odds create the new table, but the new odds arent in. When I watch the status in the bottom left hand corner it flys past importing odds. Is there something I am doing wrong, or a settign I need to change? For now I just need to close the file and reopen.
Reply With Quote
  #9  
Old 12-13-2011, 04:19 PM
Hall of Fame
 
Join Date: Oct 2005
Location: Salem, VA
Posts: 22,450
Rewards: 1,800
Your cache is interfering with the new data, in other words you are drawing data from the exact same source and to save time the excel procedures default to older data in recent memory. What you need to do is add the Pinnacle Feed Time to the end of the URL with "&last=XXXXXXXXXXX" where "X" is a sequence of numbers.

You can grab it with

Quote:
xmlLoad.DocumentElement.ChildNodes(0).FirstChild.T ext
Where "xmlLoad" is the name of the defined Dom Document
__________________
"Nobody goes there anymore, its too crowded." --Yogi Berra

"Always tell the truth, that way you won't have to remember what you said." --Mark Twain


*=$50,000
Reply With Quote
  #10  
Old 12-13-2011, 06:00 PM
Registered User
 
Join Date: Dec 2011
Posts: 3
Rewards: 7
Thank you for the reply, I am novice at best what you stated makes sense its just a matter of my ability to do it that is killing me. I also only need one sport NCAA Basketball would that make matters easier?
Reply With Quote
  #11  
Old 12-14-2011, 11:36 AM
Registered User
 
Join Date: Dec 2011
Posts: 3
Rewards: 7
Quote:
Originally Posted by uva3021 View Post
Your cache is interfering with the new data, in other words you are drawing data from the exact same source and to save time the excel procedures default to older data in recent memory. What you need to do is add the Pinnacle Feed Time to the end of the URL with "&last=XXXXXXXXXXX" where "X" is a sequence of numbers.

You can grab it with



Where "xmlLoad" is the name of the defined Dom Document
I'm really hitting a wall with this one, not sure if this is even appropriate or if the rate is even worth your time, but I would be willing to pay you say $30 to fix up my version of the above file. Let me know if this is something you would be interested in taking on.
Reply With Quote
  #12  
Old 01-27-2012, 09:43 AM
Registered User
 
Join Date: May 2010
Posts: 11
Rewards: 295
aa441995,

Glad to hear someone is getting some benefit from my sheet and sorry for the late response. I haven't been active here in a while.

Do you still need it fixed? If you do, I can take a look at it. If uva's suggestion solves the issue (which past history tells me it does) it should be pretty easy for me to change it and upload an updated version here.
Reply With Quote
  #13  
Old 01-27-2012, 09:14 PM
Registered User
 
Join Date: May 2010
Posts: 11
Rewards: 295
I checked my workbook and it seems the Pinny's xml URL had changed slightly so I updated it. Pinny says in the xml feed instructions that one can either load the entire xml or only the odds that have changed since last time using "&last=xxxxxxxxxx" the way uva described it. The main xml feed is only updated once every 10 mins, which is why one might not see any updated odds if re-importing the odds after 5 min.

I added the feature of importing only the changed odds. In the sheet called "User input", select "Full" to import all odds or "Incremental" to only import the odds that were changed since last time. Keep in mind that if you choose "Incremental" odds that were not updated will not show at all so it will appear that some available odds are missing.
Attached Files
File Type: xlsm Pinnacle XML feed macro 01-27-2012.xlsm (764.7 KB, 9 views)
Reply With Quote
Reply

Bookmarks

Thread Tools
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

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:59 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.