AutoScores Replacement

Forum Play Office Pools PHPFootball Support Hacks and modifications AutoScores Replacement

This topic contains 14 replies, has 3 voices, and was last updated by  rlabus 2 years ago.

  • Author
    Posts
  • #6706
    ELOP
    ELOP
    Keymaster

    Previously we have been using the site http://ffstats.us/gameStats.php?gameID=$game in the football.class.php file for our autoscores. Well that site is no longer available. Last year I used the attached code to pull scores from nfl.com just in case ffstats.us went down. Just upload it to your football pool directory and run from a cron. If you want to test it before the season add a pre season game. Hopefully it will work well again this year.

    Attachments:
    You must be logged in to view attached files.
  • #6720

    BFLOsOWN
    Participant

    How would I set up a Cron job for this? I use Cpanel….. Any help would be great.

  • #6722
    ELOP
    ELOP
    Keymaster

    You can use wget in your cron

    wget -q -O – ‘http://yourdomain.com/phpfootball/getscores.php’

  • #6723
    ELOP
    ELOP
    Keymaster

    Set it to every 10-15 minutes

  • #6834

    rlabus
    Participant

    is this working this year i can not seem to get it to run. im trying to run it thru cpanel as a cron job. any help would be appreciated

     

     

    thanks bob

  • #6854
    ELOP
    ELOP
    Keymaster

    Yes this is working, are you getting errors in your logs. You can also run it from the browser to see if it is working

    • #6858

      rlabus
      Participant

      select * from phpfb_schedule where week = 3 order by gametime ASCselect * from phpfb_schedule where week = 3 order by gametime ASC<br><br>Game Time:1474590300<br><br>Game Date:20160922<br><br>20160922—–20160926<br>20160922—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474833900<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474833900<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474835100<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474835100<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474835100<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474849800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474936200<br><br>Game Date:20160926<br><br>20160926—–20160926<br>20160926—–20160925<br><br>jsonid:2016092600<br><br><br><br><br><br>ATL  vs NO  Quarter <BR>update phpfb_schedule set vscore = , hscore = , result = ”, sresults = ”,status = ‘QTR:  ‘ where week = 3 and hid = ‘NO’

      This is in the log but scores are not populating same result when i run it manually

  • #6859
    ELOP
    ELOP
    Keymaster

    That is what mine looks like as well. Since you are running it today it is only going to pick up today’s game. You will need to run it tonight while the game is on to see if it is picking up the scores. If it is and scores still aren’t being posted to your DB you may have an SQL issue with your update line in your script.

    I modified the script below to pull in yesterdays scores. just to see if you are getting the proper values. If this works the other should not have any issues. This one will only work on games before today

    Attachments:
    You must be logged in to view attached files.
    • #6861

      rlabus
      Participant

      Game Time:1474590300

      Game Date:20160922

      20160922—–20160926
      20160922—–20160925

      jsonid:2016092200

      HOU 27 vs NE 0 QuarterFinal 00:36
      update phpfb_schedule set vscore = 0, hscore = 27, result = ‘NE’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘NE’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092501

      MIN 10 vs CAR 22 QuarterFinal 00:21
      update phpfb_schedule set vscore = 22, hscore = 10, result = ‘MIN’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘CAR’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092502

      DEN 17 vs CIN 29 QuarterFinal 00:28
      update phpfb_schedule set vscore = 29, hscore = 17, result = ‘DEN’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘CIN’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092503

      DET 34 vs GB 27 QuarterFinal 00:39
      update phpfb_schedule set vscore = 27, hscore = 34, result = ‘GB’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘GB’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092504

      BAL 17 vs JAC 19 QuarterFinal 00:15
      update phpfb_schedule set vscore = 19, hscore = 17, result = ‘BAL’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘JAC’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092505

      CLE 30 vs MIA 24 Quarterfinal overtime 08:26
      update phpfb_schedule set vscore = 24, hscore = 30, result = ‘MIA’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘MIA’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092506

      WAS 27 vs NYG 29 QuarterFinal 00:22
      update phpfb_schedule set vscore = 29, hscore = 27, result = ‘WAS’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘NYG’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092507

      OAK 10 vs TEN 17 QuarterFinal 00:12
      update phpfb_schedule set vscore = 17, hscore = 10, result = ‘OAK’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘TEN’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092508

      SF 37 vs SEA 18 QuarterFinal 00:13
      update phpfb_schedule set vscore = 18, hscore = 37, result = ‘SEA’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘SEA’

      Game Time:1474833900

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092509

      LA 32 vs TB 37 QuarterFinal 00:04
      update phpfb_schedule set vscore = 37, hscore = 32, result = ‘LA’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘TB’

      Game Time:1474833900

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092510

      PIT 34 vs PHI 3 QuarterFinal 00:29
      update phpfb_schedule set vscore = 3, hscore = 34, result = ‘PHI’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘PHI’

      Game Time:1474835100

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092511

      SD 26 vs IND 22 QuarterFinal 00:00
      update phpfb_schedule set vscore = 22, hscore = 26, result = ‘IND’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘IND’

      Game Time:1474835100

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092512

      NYJ 24 vs KC 3 QuarterFinal 00:39
      update phpfb_schedule set vscore = 3, hscore = 24, result = ‘KC’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘KC’

      Game Time:1474835100

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092513

      CHI 31 vs DAL 17 QuarterFinal 00:02
      update phpfb_schedule set vscore = 17, hscore = 31, result = ‘DAL’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘DAL’

      Game Time:1474849800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092514

      vs Quarter
      update phpfb_schedule set vscore = , hscore = , result = ”, sresults = ”,status = ‘QTR: ‘ where week = 3 and hid = ”

      Game Time:1474936200

      Game Date:20160926

      20160926—–20160926
      20160926—–20160925

      jsonid:2016092615

      vs Quarter
      update phpfb_schedule set vscore = , hscore = , result = ”, sresults = ”,status = ‘QTR: ‘ where week = 3 and hid = ”

       

      ok this is what i get when i run the new script. now i’m going to ask some dumb questions. is there something that i need to do so this will write to the database? (i have not modified your script at all) i know only enough to be dangerous 🙂

  • #6862
    ELOP
    ELOP
    Keymaster

    You should not have to do anything as long as you db names are the same as in your script. Check your phpfb_schedule table to see if they updated

    • #6863

      rlabus
      Participant

      phpfb_schedule

      this is the table name

      degeii5_bawkfootball

      this is the database name

      but they are not updating

  • #6864
    ELOP
    ELOP
    Keymaster

    If you were not connecting to the DB you would be receiving errors stating that

    Did you try putting the full path for require(“football.class.php”);

  • #6865
    ELOP
    ELOP
    Keymaster

    Found the issue. I had an extra column in m table called status which pulled in the quarter, time etc. I took that out of the script and it should work fine with your DB. Use the new attached version

  • #6866
    ELOP
    ELOP
    Keymaster

    It didn’t attach here it is again

    Attachments:
    You must be logged in to view attached files.
    • #6875

      rlabus
      Participant

      sorry i did not see this before monday’s game i will upload and let you know

      thanks for all the work you put into this

      bob

  • Author
    Posts
  • #6706
    ELOP
    ELOP
    Keymaster

    Previously we have been using the site http://ffstats.us/gameStats.php?gameID=$game in the football.class.php file for our autoscores. Well that site is no longer available. Last year I used the attached code to pull scores from nfl.com just in case ffstats.us went down. Just upload it to your football pool directory and run from a cron. If you want to test it before the season add a pre season game. Hopefully it will work well again this year.

    Attachments:
    You must be logged in to view attached files.
  • #6720

    BFLOsOWN
    Participant

    How would I set up a Cron job for this? I use Cpanel….. Any help would be great.

  • #6722
    ELOP
    ELOP
    Keymaster

    You can use wget in your cron

    wget -q -O – ‘http://yourdomain.com/phpfootball/getscores.php’

  • #6723
    ELOP
    ELOP
    Keymaster

    Set it to every 10-15 minutes

  • #6834

    rlabus
    Participant

    is this working this year i can not seem to get it to run. im trying to run it thru cpanel as a cron job. any help would be appreciated

     

     

    thanks bob

  • #6854
    ELOP
    ELOP
    Keymaster

    Yes this is working, are you getting errors in your logs. You can also run it from the browser to see if it is working

    • #6858

      rlabus
      Participant

      select * from phpfb_schedule where week = 3 order by gametime ASCselect * from phpfb_schedule where week = 3 order by gametime ASC<br><br>Game Time:1474590300<br><br>Game Date:20160922<br><br>20160922—–20160926<br>20160922—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474822800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474833900<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474833900<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474835100<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474835100<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474835100<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474849800<br><br>Game Date:20160925<br><br>20160925—–20160926<br>20160925—–20160925<br><br>Game Time:1474936200<br><br>Game Date:20160926<br><br>20160926—–20160926<br>20160926—–20160925<br><br>jsonid:2016092600<br><br><br><br><br><br>ATL  vs NO  Quarter <BR>update phpfb_schedule set vscore = , hscore = , result = ”, sresults = ”,status = ‘QTR:  ‘ where week = 3 and hid = ‘NO’

      This is in the log but scores are not populating same result when i run it manually

  • #6859
    ELOP
    ELOP
    Keymaster

    That is what mine looks like as well. Since you are running it today it is only going to pick up today’s game. You will need to run it tonight while the game is on to see if it is picking up the scores. If it is and scores still aren’t being posted to your DB you may have an SQL issue with your update line in your script.

    I modified the script below to pull in yesterdays scores. just to see if you are getting the proper values. If this works the other should not have any issues. This one will only work on games before today

    Attachments:
    You must be logged in to view attached files.
    • #6861

      rlabus
      Participant

      Game Time:1474590300

      Game Date:20160922

      20160922—–20160926
      20160922—–20160925

      jsonid:2016092200

      HOU 27 vs NE 0 QuarterFinal 00:36
      update phpfb_schedule set vscore = 0, hscore = 27, result = ‘NE’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘NE’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092501

      MIN 10 vs CAR 22 QuarterFinal 00:21
      update phpfb_schedule set vscore = 22, hscore = 10, result = ‘MIN’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘CAR’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092502

      DEN 17 vs CIN 29 QuarterFinal 00:28
      update phpfb_schedule set vscore = 29, hscore = 17, result = ‘DEN’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘CIN’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092503

      DET 34 vs GB 27 QuarterFinal 00:39
      update phpfb_schedule set vscore = 27, hscore = 34, result = ‘GB’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘GB’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092504

      BAL 17 vs JAC 19 QuarterFinal 00:15
      update phpfb_schedule set vscore = 19, hscore = 17, result = ‘BAL’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘JAC’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092505

      CLE 30 vs MIA 24 Quarterfinal overtime 08:26
      update phpfb_schedule set vscore = 24, hscore = 30, result = ‘MIA’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘MIA’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092506

      WAS 27 vs NYG 29 QuarterFinal 00:22
      update phpfb_schedule set vscore = 29, hscore = 27, result = ‘WAS’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘NYG’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092507

      OAK 10 vs TEN 17 QuarterFinal 00:12
      update phpfb_schedule set vscore = 17, hscore = 10, result = ‘OAK’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘TEN’

      Game Time:1474822800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092508

      SF 37 vs SEA 18 QuarterFinal 00:13
      update phpfb_schedule set vscore = 18, hscore = 37, result = ‘SEA’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘SEA’

      Game Time:1474833900

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092509

      LA 32 vs TB 37 QuarterFinal 00:04
      update phpfb_schedule set vscore = 37, hscore = 32, result = ‘LA’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘TB’

      Game Time:1474833900

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092510

      PIT 34 vs PHI 3 QuarterFinal 00:29
      update phpfb_schedule set vscore = 3, hscore = 34, result = ‘PHI’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘PHI’

      Game Time:1474835100

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092511

      SD 26 vs IND 22 QuarterFinal 00:00
      update phpfb_schedule set vscore = 22, hscore = 26, result = ‘IND’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘IND’

      Game Time:1474835100

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092512

      NYJ 24 vs KC 3 QuarterFinal 00:39
      update phpfb_schedule set vscore = 3, hscore = 24, result = ‘KC’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘KC’

      Game Time:1474835100

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092513

      CHI 31 vs DAL 17 QuarterFinal 00:02
      update phpfb_schedule set vscore = 17, hscore = 31, result = ‘DAL’, sresults = ”,status = ‘Final’ where week = 3 and hid = ‘DAL’

      Game Time:1474849800

      Game Date:20160925

      20160925—–20160926
      20160925—–20160925

      jsonid:2016092514

      vs Quarter
      update phpfb_schedule set vscore = , hscore = , result = ”, sresults = ”,status = ‘QTR: ‘ where week = 3 and hid = ”

      Game Time:1474936200

      Game Date:20160926

      20160926—–20160926
      20160926—–20160925

      jsonid:2016092615

      vs Quarter
      update phpfb_schedule set vscore = , hscore = , result = ”, sresults = ”,status = ‘QTR: ‘ where week = 3 and hid = ”

       

      ok this is what i get when i run the new script. now i’m going to ask some dumb questions. is there something that i need to do so this will write to the database? (i have not modified your script at all) i know only enough to be dangerous 🙂

  • #6862
    ELOP
    ELOP
    Keymaster

    You should not have to do anything as long as you db names are the same as in your script. Check your phpfb_schedule table to see if they updated

    • #6863

      rlabus
      Participant

      phpfb_schedule

      this is the table name

      degeii5_bawkfootball

      this is the database name

      but they are not updating

  • #6864
    ELOP
    ELOP
    Keymaster

    If you were not connecting to the DB you would be receiving errors stating that

    Did you try putting the full path for require(“football.class.php”);

  • #6865
    ELOP
    ELOP
    Keymaster

    Found the issue. I had an extra column in m table called status which pulled in the quarter, time etc. I took that out of the script and it should work fine with your DB. Use the new attached version

  • #6866
    ELOP
    ELOP
    Keymaster

    It didn’t attach here it is again

    Attachments:
    You must be logged in to view attached files.
    • #6875

      rlabus
      Participant

      sorry i did not see this before monday’s game i will upload and let you know

      thanks for all the work you put into this

      bob

You must be logged in to reply to this topic.