Skip to content
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

Remove Selenium dependency #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ssiegel
Copy link

@ssiegel ssiegel commented Nov 19, 2015

The new code uses the (internal) BGG JSON API directly.
This removes many dependencies, speeds up the process, makes it more
reliable and makes it possible to handle several copies of a game at
the same time.

When "collid" is empty or --force-new is given, the importer creates
new copies of the games. Without --force-new and with non-empty
"collid" matching existing copies of the games will be updated.

The new code uses the (internal) BGG JSON API directly.
This removes many dependencies, speeds up the process, makes it more
reliable and makes it possible to handle several copies of a game at
the same time.

When "collid" is empty or --force-new is given, the importer creates
new copies of the games. Without --force-new and with non-empty
"collid" matching existing copies of the games will be updated.
@syllant
Copy link
Owner

syllant commented Nov 20, 2015

Thanks, this seems great, I'll have a look and will test later!

Although I could have a concern regarding legal aspects, because BGG ToS state:

You shall not use or launch any automated system, including without limitation "robots," "spiders," or "offline readers," that accesses the Website in a manner that sends more request messages to the Geekdo servers in a given period of time than a human can reasonably produce in the same period by using a conventional online web browser, except as expressly permitted by Geekdo

Relying on a web browser allows me to conform to these terms, whereas relying on batch HTTP calls would probably violate them and would need an explicit permission from BGG. I'll double check that.

Thanks again for sharing.

There might be other viable alternatives:

  - Create new copies by default, and introduce some --update switch
    to update the existing collection.

  - Add a completely new command for updating the collection, like e.g.
    collection-update.

  - Detect if the "collid" to be imported is already in the collection.
    Then update if it is, or add a copy if it is not. This solution
    probably exhibits the least surprising behavior for the user, but
    it requires an additional request per imported record or a complete
    export beforehand.
@ssiegel
Copy link
Author

ssiegel commented Nov 20, 2015

You shall not use or launch any automated system, including without limitation "robots," "spiders," or "offline readers," that accesses the Website in a manner that sends more request messages to the Geekdo servers in a given period of time than a human can reasonably produce in the same period by using a conventional online web browser, except as expressly permitted by Geekdo

In that case it might be in order to throttle the requests, with a default delay in line with the ToS. If it is configurable, users could then lower the delay (possibly violating the ToS) at their own discretion.

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.

None yet

2 participants