Giter VIP home page Giter VIP logo

Comments (12)

mickeelm avatar mickeelm commented on August 17, 2024 2

Maybe a separate issue for the new scorestrip-JS? Otherwise regarding the latest discussion - what @ochawkeye said.

Regarding the scheduling. If we begin with

But if there were an alternate way to inform nflgame of the current week that functionality could be returned.

I think that it could be pretty robustly fixed just using the scheduling rules (the regular season starts the weekend after Labor day), which are available on Wikipedia. I've used this (comparing today's date with the scheduling rules to rule out which week we're at) in my own application and it has worked for me. I'll just have to translate it into Python. I'll get on it.

Also, @derek-adair, I need some clarification on this:

I would like to be lazy and not have to run update_schedule.py --year every time the schedule changes, a game is added or a new season starts.

Like, do you never want to run the script at all or not with the --year parameter specifically?

I don't mind running the script, but I'd like it to behave like this

  • Using the season scheduling logic, determine where we are in a season (or after/before a season).
  • Check the last post of schedule.json to see if we're up to date. If the script is run in PRE3 for instance and the last game in the file is POST4 (Super Bowl), fetch PRE1, PRE2, PRE3 and possibly x weeks ahead (PRE4, REG1...).
  • parameters like --year still do what they did before.

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024 1

Run mode is a good idea.

I have been pretty busy with other things but this week I will have some time to do more planning, organizing and the like.

from nflgame.

mickeelm avatar mickeelm commented on August 17, 2024

+1 on this, I'll try to dig in on it a bit. Especially with the change in #3, this seems even more prioritized as that URL would have to be updated every week. I just submitted pull request #6 which includes the whole 2018 schedule though so we should be good for a while (but the schedule could change!).

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024

The schedule could change!

Yup! This is the main reason for me. Last year there was a cancellation which was a bit of a pain to handle w/ my personal setup.

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024

.... would have to be updated every week

Oh hey good catch, i think you ca probably remove the week paramater and get the entire schedule.

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024

Another potentially troubling issue is that the data returned could be different and/or incomplete.

from nflgame.

ochawkeye avatar ochawkeye commented on August 17, 2024

The schedule definitely changes throughout the year, even without a hurricane like the one that that moved a game by 10 weeks last season.
Most of the second half of the season Sunday night games are "flex" games. They can and do shuffle around a few weeks before they occur.

In most cases, a user really only needs to be aware of a schedule change the week that the games are actually happening. That is part of the reason that update_schedule.py by default only updates the current week (but can be overridden with the --year flag). Since nflgame.live.current_year_and_week() is no longer functioning, this piece is broken. But if there were an alternate way to inform nflgame of the current week that functionality could be returned.

Could be as simple as a calendar until we find something better

if date between September 4th 2018 and September 10th 2018:
    _cur_year = 2018
    _cur_week = 1

Not very efficient long-term, but would be an easy short term fix.

I do notice that NFL.com has a new score strip on their pages. A whole lotta JavaScript running it, but maybe someone with more network sniffing acumen could locate a concise source of that info (if it exists)?

Closely related with #3
Cross-posting with BurntSushi#363

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024

I can take a look i've been thinking of various ways we can make this project better and one of my big complaints is the way in which the code interacts with nfl.com. Its pretty damned unclear where the data comes from, and how it is manipulated, queried etc. without digging in and completely understanding the code.. A lot of this, as it turns out, is because nfl.com has no clear way to interact with their data.

from nflgame.

ochawkeye avatar ochawkeye commented on August 17, 2024

A lot of this, as it turns out, is because nfl.com has no clear way to interact with their data.

That's...that's kind of the entire point. If the NFL had an API this library wouldn't be necessary. This library is not sanctioned by NFL.com.

Maybe this is just semantics, but to be clear, none of the data is manipulated, queried, etc. directly from NFL.com. That would lead to thousands of calls to NFL.com and most certainly an eventual - if not nearly immediate - cease and desist request from them.

The data all comes from the .json files that run the NFL.com Game Center pages. Those files are pulled local , parsed, and read into memory (or stored in a database in the case of nfldb) where they can manipulated, queried, etc.

I do not agree that a complete understanding of the code is necessary to work with the library.

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024

I do not agree that a complete understanding of the code is necessary to work with the library.

I did not mean this. It is quite user friendly to the end user. Not so much if you are seeking to modify and/or debug things. Just some minor organization things, really nothing major. Anyways, my comment was probably out of place anyways and deserves a separate issue for addressing the scorestrip being depreicated.

Also your description is very good and desrves to be in the wiki or somewhere because it would have saved me some time :D

from nflgame.

mickeelm avatar mickeelm commented on August 17, 2024

Still kinda hijacking this thread, sorry for that but I'm digging through the code a bit to try and understand all that's going on and then I noticed two things that I'd thought I'd bring up:

  1. I haven't tried to sniff traffic in order to find the feed that is feeding the score bar on top of NFL.com. The data used to come from http://www.nfl.com/liveupdate/scorestrip/scorestrip.json though (maybe you guys knew about this already) which now seems to be deprecated. I don't know if this new score bar has any more data from a new feed but I doubt it, graphically it kinda looks the same. Anyhow, for us this shouldn't matter as that now deprecated feed wasn't used in nflgame to begin with. From what I can see in the code, nflgame uses only the more detailed game feeds, game.py has this code:
_jsonf = path.join(path.split(__file__)[0], 'gamecenter-json', '%s.json.gz')
_json_base_url = "http://www.nfl.com/liveupdate/game-center/%s/%s_gtd.json"

With that said, it's always nice to know if we have more data feeds that we can use (but I doubt that we'll get any more info than we already get from the full game feed) but the only "pressing" issue (without workarounds) for the season should be the scheduling thing, which I hoped I solved in #8.

  1. @derek-adair reading through the comments in live.py and this wiki page I realized that this application could be run in a "forever mode" (at least the live module), which I didn't know about before. And I guess, if nflgame was running "in the background" then I 100% agree that the scheduling updates should be automatic. Maybe the whole application should be possible to run in the background, as a service (systemd etc). Or for that sake, in a python interpreter if you want to keep it in the foreground:
>>> import nflgame
>>> nflgame.run()

something like that. Like, that "run mode" would update the schedule, game data, player data and keep track of calling NFL.com during games intervals etc. If you think it sounds like a good idea I could write an issue for it.

from nflgame.

derek-adair avatar derek-adair commented on August 17, 2024

I've added a meta tag. We should try and file separate discussion issue's to avoid cross posting.

from nflgame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.