Skip to content

Add Rake task for importing covers from MobyGames #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 18, 2019

Conversation

connorshea
Copy link
Owner

This isn't quite perfect, but it works well enough that it's good to merge.

The problem is that the API doesn't expose a way to find a game by the URL fragment (e.g. terraria, half-life-2-episode-one, etc.) so I have to search by the title of the game, which is pretty flaky ("The Legend of Zelda: Ocarina of Time" returns no games 🤔 ), and then use the URL fragment I have to match with the correct game, if it's returned by the API.

Then it pulls down the cover image and attaches it to the game.

The API is pretty heavily rate limited, so we sleep for 10 seconds between every iteration in the loop. This helps make sure that we never get above 360 requests/hour. It'll take ~27 hours to get 10k games' covers.

@connorshea connorshea merged commit 25e7f90 into master May 18, 2019
@connorshea connorshea deleted the add-mobygames-covers-from-api branch May 18, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant