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

How to specify language per article in a group fetch? #414

Open
Vacilando opened this issue Dec 30, 2020 · 2 comments
Open

How to specify language per article in a group fetch? #414

Vacilando opened this issue Dec 30, 2020 · 2 comments

Comments

@Vacilando
Copy link

It's recommended (cf https://github.com/spencermountain/wtf_wikipedia#good-practice) to bundle several requests into one, like

wtf.fetch(['Royal Cinema', 'Aldous Huxley'], 'en')

However, this assumes all such requests are for articles in one language.

Is there a recommended way of specifying several articles with their languages for the group fetch?

@wvanderp
Copy link
Contributor

There is currently no way to specify the language per title.

So I think your best course of action is splitting the requests by language and sending these separately.

If we were to implement a solution for this we would have to do the same because every language has a different api endpoint.
The english wiki can answer things about the french wiki.

@Vacilando
Copy link
Author

Vacilando commented Jan 1, 2021

Indeed, makes perfect sense, @wvanderp. We'll do it that way.

Suggestion: it might be a good idea to provide a bundler of requests in wtf_wikipedia that would take any long list of targets and their languages and group them

  • by max size (default 5 or configurable)
  • by language

I think it still fits the scope of this project because it would make it easier for users to just make their list of wanted Wikimedia items without having to worry about in what batches are they palatable for the given endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants