Unable to fetch next 500 page links
There is no pagination/offset setting in the listOptions parameter when calling page.links(). This means that only the first 500 links are fetched.
The limit of 500 itself is fine, but I am missing a way to get the next 500 links. I've checked the docs and there does not seem to be a way to do this.
I experience the same issue Moreover, unless I misunderstood the API, it doesn't provide links that are relevant to the article but returns all of wikipedia links (sorted alphabetically), is that intended?
@Wiiseguy thanks for opening the issue.
You are right that the package currently does not have a way to do this. We set a max limit to the page and do not have a way to get the rest of the items right now. Do you have an example of a page with more than 500 links so that we can use it as a test when writing the relevant code for this?
Reading through the wiki query docs, i see - https://www.mediawiki.org/wiki/API:Continue - we will need to handle this parameter in case of apis using listOptions so it can show the next 500.
@ethanshar i think the links returned are relevant to the page itself. Can you give an example of this issue?
@dopecodez
Here's one: https://en.wikipedia.org/wiki/Special:WhatLinksHere/Microsoft
As a workaround for this issue I created a function that talks to the API directly and fetches links as long as there's a continue.plcontinue continue token in the response.
@Wiiseguy thanks a lot. If you would be open to sharing the code of your function here or working on a PR on wikipedia, that would be welcome. I'll look into this once the other issues are closed if not.