1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is the best way to get football league table updated automatically?

Discussion in 'PHP' started by Allen James, Sep 16, 2017.

  1. #1
    I've read some opinions that people use APIs and other are just php parsing the data. I want to hear some more opinions before I choose how to continue and what to use. I want to get the Italian Serie A league table updated automatically on a website using WordPress, because it is a lot of work to do it manually each week. And I don't need more than 4-5 requests per day, so we are talking about something really simple. Also, if there is a WP plugin, that could also help. Thank you for your time and advices!
     
    Last edited: Sep 16, 2017
    Allen James, Sep 16, 2017 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #2
    The problem with API's are they are most likely not licensed by the NFL but instead are either 1. Updated by an actual employee near real time OR 2. Fed directly by the originating source (NFL) OR 3. Scraped with a script using a public source fed by the originating source (NFL).
    My initial ideal would be to write a PHP script that fetches information from the NFL site or Wikipedia.
     
    NetStar, Sep 17, 2017 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,494
    Likes Received:
    4,457
    Best Answers:
    123
    Trophy Points:
    665
    #3
    "Italian Serie A league table" <> NFL

    Use an API if there is one but make sure the source is legitimate - I don't know enough about soccer or Italy to recommend a source but an official API is always best.

    Cost then comes into it, and the time to develop the code that uses the API but it may be an interesting learning experience and worth it.
     
    sarahk, Sep 17, 2017 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    I've done this a number of times, generally unless you want to pay licensing fees for an official API, you need to write a script to scrape and parse out scores each week. If you can find some xml or other data based score format, that's the easiest way. It may be possible to scrape a larger website, but they often are using ajax and other back end delivery methods that make it very difficult to get the data out.
     
    jestep, Sep 19, 2017 IP
    Rukbat likes this.
  5. Allen James

    Allen James Active Member

    Messages:
    120
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    53
    #5
    I think I've found a free API so I can try with it. If it's not working, then I can scrape the data.
     
    Allen James, Sep 23, 2017 IP
  6. SoftLink

    SoftLink Active Member

    Messages:
    103
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #6
    This link is the Italian Serie A Table in a format that you can easily scrape.
    I'd just write a quick PHP script that scrapes what I need from this page.

    The only downside is that every time this site changes, you'd have to change your script to match the new format.
     
    SoftLink, Oct 9, 2017 IP
  7. Harshal shah

    Harshal shah Active Member

    Messages:
    126
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    65
    #7
    select * from `xyz` where LOWER(`column`)=strtolower($foo);
     
    Harshal shah, Oct 14, 2017 IP