12/12/2023 0 Comments Sfg soccer forTime and time again, I was able to prove myself wrong by persevering. Time and time again in my programming journey, I’ve come up against a problem that I was convinced I couldn’t solve. It wouldn’t be a blog post without a moral. The code is open source and available at - feel free to host your own server or submit a pull request. You can also view the matches of any team, if you know the country’s FIFA code.ĭuring the group stages, you can get the currents results in every group (wins, losses, draws, goals_for, goals_against, and knockout status) by going to: For example, the following endpoints all work More specialized match data can be pulled in as well. (All match data in JSON, updated every minute.) Voilà – the first full JSON API for the World Cup that is publicly available for free (as far as I know). I set up a few simple associations between teams and matches in Rails, ran into some time zone issues, learned the FIFA country codes, and taught myself how to use RABL to structure the JSON output. I spent the weekend playing with scraping the HTML of a few different sites, and I was finally able to scrape in what I wanted. I decided to make it more full-featured and able to pull in the results of all the games in real time. Then, I told Casey about it here at Software for Good, and he encouraged me to build a full-fledged JSON API to be released to the world. At the beginning, I built a scraper that could get the current results of the group stages and the scores of the current match to pipe them into our company Hubot. One thing led to another, and I ended up building my own over the course of a few days. Unfortunately, they all cost at least $100. It should be a simple matter of scraping the results and putting them somewhere else.įirst, I went looking for some easy-to-parse JSON APIs. But then I got to thinking, why couldn’t we do this automatically? After all, there has to be at least 100 sites that have up-to-date scores. So I started with a simple MVP where we could all enter match results via the backend and our scores were calculated. Then I said, well, at least I can do something interesting. There’s no way I can build something that’s up-to-date automatically. After it was over, my friends asked me if I could make a website to track who was in the lead at any given time.Īs is usual for these things, I first said, well, that’s impossible. This year, we drafted the day before the Cup started. The World Cup is one of the few times we come together as an entire planet.Įvery time the World Cup rolls around, some friends and I get together and draft teams to make some of the smaller matches more interesting and to make some friendly wagers. In some countries, over 50% of the viewing population viewed that country’s matches. During the 2010 World Cup, 3.2 billion people watched at least one of the games from home. Despite the well founded concerns over corruption in FIFA and the social costs of spending so much on a sporting event, it’s truly the largest event in the world.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |