Traviskorte
Traviskorte

Reputation: 113

Diff oldest and newest revisions of article with Wikipedia API

I'm trying to design a query that returns the diff of the first and last (or oldest and newest, if you like) revisions of a given Wikipedia article, but I can't figure out a way to do it without sorting by oldest first, parsing out the top result, and diffing it with the current revision manually.

Upvotes: 0

Views: 227

Answers (1)

Bergi
Bergi

Reputation: 665536

I can't figure out a way to do it without sorting by oldest first, parsing out the top result

I don't think there is a way around this.

and diffing it with the current revision manually.

However, you can do this in one step. You can send the rvdiffto=cur parameter, so that you don't have to deduce the current revision id in an extra step.

rvprop=id|timestamp & rvlimit=1 & rvdir=newer & rvdiffto=cur

Upvotes: 1

Related Questions