1. #211
    bobbydrake
    bobbydrake's Avatar Become A Pro!
    Join Date: 02-16-09
    Posts: 38
    Betpoints: 375

    Simple Perl Web Parser Script
    I don't mean any disrespect toward the original poster's preferred programming language. This is just another method. We all need options in life.
    ---------------------------------------------------------------
    #! /usr/bin/perl
    print "Content-type: text/html\n\n";

    use LWP::Simple;

    use HTML::TreeBuilder;

    use HTML::FormatText;

    $URL = get("http://www.websiteyouwanttoparse.com");

    $Format = HTML::FormatText->new;

    $TreeBuilder = HTML::TreeBuilder->new;

    $TreeBuilder->parse($URL);

    $Parsed = $Format->format($TreeBuilder);

    print "$Parsed";
    open(FILE, ">file.txt");
    print FILE "$Parsed";
    close(File);

    exit;
    --------------------------------------------------------------
    Things you need to edit:
    $URL = get("http://www.websiteyouwanttoparse.com");
    Change the website name to a website you want to parse. If you know a little perl, those quotations have to be included.

    and also edit
    open(FILE, ">file.txt");
    Change file.txt to a file name of your choice. Remember to change this every time you parse a new website or you'll have this program delete all the info on that file from a previous save.

    This is my opinion. I take no responsibility for your actions. This is only for educational purposes.
    Last edited by bobbydrake; 03-09-12 at 03:04 PM. Reason: format

  2. #212
    SBFootball
    SBFootball's Avatar Become A Pro!
    Join Date: 02-18-12
    Posts: 12

    thanks. my friend

  3. #213
    Lovin'life
    Lovin'life's Avatar Become A Pro!
    Join Date: 02-22-12
    Posts: 31
    Betpoints: 31

    For ideas on what you can do with the data search kindergartencapper tournament spreadsheet it is a google spreadsheet a guy made for NCAA great for ideas. I haven't done any of this and this forum caught my attention. I found this spreadsheet and am now serious. I start reading Baseball Hacks today.

  4. #214
    superjeff24
    superjeff24's Avatar Become A Pro!
    Join Date: 03-17-10
    Posts: 1,078
    Betpoints: 66

    ok noob question:

    Is this just for doing arbitrage, or would this be something you can use for regular sports betting? What is the advantage of using a spreadsheet? Will it make it easier to keep track of profits/losses? I'm about to start the book, hopefully someone can help a noob out here. THanks

  5. #215
    PokerSource
    PokerSource's Avatar Become A Pro!
    Join Date: 04-15-12
    Posts: 20
    Betpoints: 54

    Great thread.

  6. #216
    Investapick
    Investapick's Avatar Become A Pro!
    Join Date: 06-11-12
    Posts: 7
    Betpoints: 30

    A lot of good info

  7. #217
    lecubs28
    Keepin em Honest
    lecubs28's Avatar Become A Pro!
    Join Date: 10-17-11
    Posts: 638
    Betpoints: 5422

    thanks for all the useful info in this thread. it is a very good guide for the things i'm trying to learn.

    currently i'm working through the python book recommended by the op. i have no previous coding experience, so it is slow but rewarding. i am having trouble opening a file in python though. here's the syntax of file "chaos.py"

    Code:
    def main ():    print "this program illustrates chaotic function"
        x = input ("enter number btwn 0 and 1: ")
        for i in range (10):
            x = 3.9 * x * (1-x)
            print x
    it runs just fine

    Code:
    main ()this program illustrates chaotic function
    enter number btwn 0 and 1: .4
    0.936
    0.2336256
    0.698274248196
    0.821680557759
    0.571434313164
    0.955098841721
    0.16725167263
    0.543186347468
    0.96772626363
    0.121805355011
    but when i try to call it from the command line i get issues:

    Code:
    python.chaos.py
    
    Traceback (most recent call last):
    File "", line 1, in 
    python.chaos.py
    NameError: name 'python' is not defined
    or if i try calling just chaos.py, similar error message:

    Code:
    Traceback (most recent call last):  File "", line 1, in 
        chaos.py
    NameError: name 'chaos' is not defined
    what am i doing wrong?
    -----------------------------------------------------------------------
    also my friend recommended i learn python using codeacademy. anybody have anything to say regarding whether codeacademy or the zelle book (the one in the op) is better, or what each is better for?

  8. #218
    CoverOne
    CoverOne's Avatar Become A Pro!
    Join Date: 07-11-12
    Posts: 42
    Betpoints: 86

    So I am completely unfamiliar with coding and programming, but is it actually possible to have a program automatically gather box score data and update daily saved into an excel file? If that's possible and relatively easy to learn, my betting habits may become much easier...

  9. #219
    moneylineer
    moneylineer's Avatar Become A Pro!
    Join Date: 09-11-10
    Posts: 21
    Betpoints: 198

    Quote Originally Posted by lecubs28 View Post
    thanks for all the useful info in this thread. it is a very good guide for the things i'm trying to learn.

    currently i'm working through the python book recommended by the op. i have no previous coding experience, so it is slow but rewarding. i am having trouble opening a file in python though. here's the syntax of file "chaos.py"

    Code:
    def main ():    print "this program illustrates chaotic function"
        x = input ("enter number btwn 0 and 1: ")
        for i in range (10):
            x = 3.9 * x * (1-x)
            print x
    it runs just fine

    Code:
    main ()this program illustrates chaotic function
    enter number btwn 0 and 1: .4
    0.936
    0.2336256
    0.698274248196
    0.821680557759
    0.571434313164
    0.955098841721
    0.16725167263
    0.543186347468
    0.96772626363
    0.121805355011
    but when i try to call it from the command line i get issues:

    Code:
    python.chaos.py
    
    Traceback (most recent call last):
    File "", line 1, in 
    python.chaos.py
    NameError: name 'python' is not defined
    or if i try calling just chaos.py, similar error message:

    Code:
    Traceback (most recent call last):  File "", line 1, in 
        chaos.py
    NameError: name 'chaos' is not defined
    what am i doing wrong?
    -----------------------------------------------------------------------
    also my friend recommended i learn python using codeacademy. anybody have anything to say regarding whether codeacademy or the zelle book (the one in the op) is better, or what each is better for?


    Try python chaos.py

    If that doesn't work, then check your PATH through Environment Variables (through control panel in System, Advanced Settings) and make sure Python is in the PATH: column.

    Hope this helps.

  10. #220
    ljump12
    ljump12's Avatar Become A Pro!
    Join Date: 12-08-09
    Posts: 108
    Betpoints: 258

    Quote Originally Posted by CoverOne View Post
    So I am completely unfamiliar with coding and programming, but is it actually possible to have a program automatically gather box score data and update daily saved into an excel file? If that's possible and relatively easy to learn, my betting habits may become much easier...
    It's absolutely possible.

  11. #221
    BALISTIK
    BALISTIK's Avatar Become A Pro!
    Join Date: 07-16-12
    Posts: 326
    Betpoints: 605

    What if I can't find Python 2.6.* anywhere am I SOL?

  12. #222
    CoverOne
    CoverOne's Avatar Become A Pro!
    Join Date: 07-11-12
    Posts: 42
    Betpoints: 86

    Quote Originally Posted by ljump12 View Post
    It's absolutely possible.
    How difficult to learn?

  13. #223
    Maverick22
    Maverick22's Avatar Become A Pro!
    Join Date: 04-10-10
    Posts: 807
    Betpoints: 58

    Very difficult and labor intensive

  14. #224
    CoverOne
    CoverOne's Avatar Become A Pro!
    Join Date: 07-11-12
    Posts: 42
    Betpoints: 86

    Quote Originally Posted by Maverick22 View Post
    Very difficult and labor intensive
    Booo

  15. #225
    Maverick22
    Maverick22's Avatar Become A Pro!
    Join Date: 04-10-10
    Posts: 807
    Betpoints: 58

    Anything worth having, rarely comes easy. Excel has some data import/web query thing. You may want to look into that.

  16. #226
    uva3021
    uva3021's Avatar Become A Pro!
    Join Date: 03-01-07
    Posts: 537
    Betpoints: 381

    Quote Originally Posted by BALISTIK View Post
    What if I can't find Python 2.6.* anywhere am I SOL?
    You might have 2.7, if you have neither just download python 2.6

  17. #227
    BALISTIK
    BALISTIK's Avatar Become A Pro!
    Join Date: 07-16-12
    Posts: 326
    Betpoints: 605

    Quote Originally Posted by uva3021 View Post
    You might have 2.7, if you have neither just download python 2.6
    Thanks for the reply. I did have 2.7 but when i tried to save after editing in IDLE, it wouldnt let me open from my desktop. So I thought I would try to find 2.6. Do you have a link I can get 2.6 from, since that is what the op says to use? thanks again.

  18. #228
    ljump12
    ljump12's Avatar Become A Pro!
    Join Date: 12-08-09
    Posts: 108
    Betpoints: 258

    Quote Originally Posted by BALISTIK View Post
    Thanks for the reply. I did have 2.7 but when i tried to save after editing in IDLE, it wouldnt let me open from my desktop. So I thought I would try to find 2.6. Do you have a link I can get 2.6 from, since that is what the op says to use? thanks again.
    Just use the most recent 2.x version, it will be fine

  19. #229
    caveira
    caveira's Avatar Become A Pro!
    Join Date: 08-07-11
    Posts: 532
    Betpoints: 1004

    Excelent ljump12! Keep updating for us!

  20. #230
    zorba74
    zorba74's Avatar Become A Pro!
    Join Date: 07-27-11
    Posts: 68
    Betpoints: 2329

    This is a fantastic thread. Why did Jump not go over Part 2? I was looking forward to learning more about the possibilities of using Excel.

  21. #231
    Inspirited
    Inspirited's Avatar SBR PRO
    Join Date: 06-26-10
    Posts: 1,783
    Betpoints: 17864

    There are now a ton of free courses available.

    At udacity you can learn python by taking cs101 and learn basic statistics by taking ST101.

    http://www.udacity.com/courses

    Coursera has a stats class where you'll be using R. They have some introductory programming courses, a couple machine learning courses and a lot of other data analysis type classes coming up in the future. They also have intro to finance and another comp finance course.

    https://www.coursera.org/courses

    EdX has some introductory programming classes and Intro to Artificial Intelligence.

    https://www.edx.org/

  22. #232
    zorba74
    zorba74's Avatar Become A Pro!
    Join Date: 07-27-11
    Posts: 68
    Betpoints: 2329

    Thank you very much Inspirited; your links were very helpful and I already signed up for the basic stat course at Udacity.

    I did some poking around on the other links and couldn't find anything relating to Excel. Will these links help me become more conversant in Excel as well?

    Thank you again.

  23. #233
    Inspirited
    Inspirited's Avatar SBR PRO
    Join Date: 06-26-10
    Posts: 1,783
    Betpoints: 17864
    Points Awarded:

    MickChunky gave Inspirited 2 SBR Point(s) for this post.


  24. #234
    zorba74
    zorba74's Avatar Become A Pro!
    Join Date: 07-27-11
    Posts: 68
    Betpoints: 2329

    Thank you Inspirited.

  25. #235
    MikeJohnson
    MikeJohnson's Avatar Become A Pro!
    Join Date: 10-02-12
    Posts: 1

    Hello guys - great post. I'm new to SBR, but an avid sports enthusiast and bettor (semi-pro I like to think), for to many years now. Wanted to throw a thought into this thread for those seeking to learn the code side to build a model (which I did many many moons ago), take a step back and evaluate how much time and the cost of your time is involved to learn and apply...unless you take it up as a hobby. The approach that evolved over time and works phenominal for me is to define your requirements and outsource to offshore development teams. There are pros/cons to this of course (I learned these the good and bad the hard way), but its a) affordable, b) takes some time to find a quality team/guy, c) leave it to the experts to build your model or your scraping scripts, and d) estimate the offset cost of your time to learn and build, test, mess up, do again, etc. than to leave it to the experts.
    I've evolved my model over the years with this approach for a number of back-burner projects, and my sports modelling.

    My $0.02 for those who get the fear factor with having to learn programming or get wet in this area. Hire a pro...not the sexy kind of pros, but the technical kind...ok, digging a hole here.

    Hope this helps those who seek a different path to get to the same destination.

  26. #236
    omgkyleflavin
    omgkyleflavin's Avatar Become A Pro!
    Join Date: 10-09-12
    Posts: 3
    Betpoints: 54

    I'm in the process of reading the recommended Python book. I'm wondering if it eventually covers getting your data to appear on an excel spreadsheet? Not sure if anyone else has read it but I'm hoping to have some spreadsheets ready for CBB and I'm worried that getting my data to excel will be the hardest part.

  27. #237
    sayhey69
    sayhey69's Avatar Become A Pro!
    Join Date: 04-16-12
    Posts: 50
    Betpoints: 398

    write to csv

  28. #238
    tha
    tha's Avatar Become A Pro!
    Join Date: 12-10-12
    Posts: 9
    Betpoints: 58

    I understand the kind intention of this post but I cannot believe anyone can do it. I also get the 'no pain, no gain' deal behind anything but it seems like just too much for anyone pick up over a few days and use it to their advantage.

  29. #239
    Zombie Woof
    Zombie Woof's Avatar Become A Pro!
    Join Date: 09-01-12
    Posts: 26
    Betpoints: 24

    Life...

    Life is good!

  30. #240
    Inspirited
    Inspirited's Avatar SBR PRO
    Join Date: 06-26-10
    Posts: 1,783
    Betpoints: 17864

    Quote Originally Posted by tha View Post
    I understand the kind intention of this post but I cannot believe anyone can do it. I also get the 'no pain, no gain' deal behind anything but it seems like just too much for anyone pick up over a few days and use it to their advantage.
    it's not gonna happen over a few days. u just have to keep at it.

  31. #241
    Sweettooth
    Sweettooth's Avatar Become A Pro!
    Join Date: 02-22-13
    Posts: 30
    Betpoints: 246

    Should offer apprenticeships for % of your pupils winnings or something.

  32. #242
    Hadley13
    Hadley13's Avatar Become A Pro!
    Join Date: 03-03-13
    Posts: 125
    Betpoints: 576

    Sorry but I'm very new to how these systems work. Do your systems weigh for different variables and spit out a point spread, that you then compare against Vegas' line?

  33. #243
    scottgodson1985
    Update your status
    scottgodson1985's Avatar Become A Pro!
    Join Date: 11-17-12
    Posts: 326
    Betpoints: 11160

    thanks man excellent post

  34. #244
    mikmak
    mikmak's Avatar Become A Pro!
    Join Date: 05-03-13
    Posts: 29
    Betpoints: 239

    Wow ... great post. Thanks to whoever stickied this.

    EDIT: Oh ... and of course ... thank you to lJump12 for the great writeup.
    Last edited by mikmak; 05-07-13 at 12:51 PM.

  35. #245
    Inspirited
    Inspirited's Avatar SBR PRO
    Join Date: 06-26-10
    Posts: 1,783
    Betpoints: 17864

    Would anyone be interested in a basic sports analytics book that is based on R or Python?

First ... 456789 Last
Top