Hi,
I've been using the Wikimedia API to fetch revisions given the revid. However, I need to make two calls to the API, one to get the page title and then another to get the revisions.
Initially I thought that a revid would be enough but this call does not work:
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop...
Only works when "titles" is defined:
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop...
Am I missing something or is this the only way to it?
Thanks in advance, -- Sérgio Nunes
api.php?action=query&prop=revisions&revids=12345|67589|59|126 Will fetch revisions 12345, 67589, 59 and 126.
Yes, this works. However I only have a single revid and I want to retrieve both this revision and the previous one. To achieve this I need to call the API twice, one to get the title and then the second one to retrieve the updates.
Since it seems that revids are global, I found odd the need to include both revid and title.
Regards, -- Sérgio Nunes
S. Nunes schreef:
Yes, this works. However I only have a single revid and I want to retrieve both this revision and the previous one. To achieve this I need to call the API twice, one to get the title and then the second one to retrieve the updates.
Due to MediaWiki's database layout, this cannot be fixed without hugely increasing database load. I'm sorry, but you'll just have to make your two requests.
Roan Kattouw (Catrope)
Roan Kattouw wrote:
S. Nunes schreef:
Yes, this works. However I only have a single revid and I want to retrieve both this revision and the previous one. To achieve this I need to call the API twice, one to get the title and then the second one to retrieve the updates.
Due to MediaWiki's database layout, this cannot be fixed without hugely increasing database load. I'm sorry, but you'll just have to make your two requests.
Roan Kattouw (Catrope)
Why is it so? Normal diffs don't have such problem: http://en.wikipedia.org/w/index.php?diff=prev&oldid=13135969
Platonides schreef:
Why is it so? Normal diffs don't have such problem: http://en.wikipedia.org/w/index.php?diff=prev&oldid=13135969
With normal UI diffs, you can only get one diff at a time. Through the API, you can get hundreds of revisions in one request. Looking up the previous revision for each of them means hundreds of database queries, which will kill the database.
Note: getting diffs through the API is now possible (see the "Getting differences between revisions" thread in this list).
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org