mefaba / show-geforce-on-steam

Chrome Extension: Shows Geforce Banner if game is available on Geforce Now while user is searching games on Steam Website.
https://chrome.google.com/webstore/detail/show-geforce-now-on-steam/igigngnkilldoncfnbcknnabjmiggbee?hl=en&authuser=0
MIT License
6 stars 4 forks source link

[Feature]Find Another way to use Game Data #3

Open mefaba opened 2 years ago

mefaba commented 2 years ago

We are currently getting geforce now game data staticly inside code. We should not do that. Instead we should implement API call or simple websitet scraping. 1)Look up if geforce now is providing game list through API If NOT: 2)Web Scrape Geforce Now Game List page when user enters steam website

Save data to local storage with timestamp. Next time user enters to website, check timestamp if there is already up to data game data saved on local storage, do not run web scraping function.

arcataroger commented 1 year ago

Revisiting this, I agree that we definitely shouldn't call the GFN API on every load for every user. That's just a bad practice in general, and it would create a lot of instability for the end-user (if they ever get rate-limited or whatever). In fact, the other extension (Cloud Gaming Lister) suffers from that problem frequently for me, which is how I found yours!

It's a good idea to bundle the games list with the extension, especially now that it's just a small array of IDs.

I think we might be able to use a Github Action on a schedule to check it regularly (at least once a day), fetching the latest IDs, doing a sanity check (making sure there wasn't an error, the number of games hasn't increased or decreased drastically, etc.), and then making a commit and PR for it for us to review.

There probably isn't a need to do something more real-time than that because the GFN games list doesn't change all that often to begin with. They usually publish games in batches on every GFN Thursday. Once in a while they will also add games out-of-cycle, like they did midweek with Starfield. But if we check once a day (or like once an hour, still very reasonable) we should catch those.

What do you think?