On 20.08.2008, 10:55 Brianna wrote:
Hi,
Is it possible the API could provide diffs? Ie you provide two revision IDs, get a diff-style output back. This is something that is available through MediaWiki itself via the history page, but not the API.
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Diff.php?view=markup doesn't look like it is particularly straightforward to implement, and rather than doing so, couldn't it be made available via the API?
Also... a 'diff view' would also be much more useful in the page history feeds. As they stand now they seem quite useless to me.
Thoughts?
cheers Brianna
If you want to have a fast bot, you'll eventually want to avoid generating diffs on-server. There are plenty of existing dif implementations on most of popular languages, and significant part of them if based on Algorithm::Diff just like MediaWiki's one, so results will be quite similar. The only situation where building diff HTML may be beneficial is when you don't have both texts to compare, but in that case you still may scrape index.php's diffs, throwing away everything but <table class="diff> contents.
Probavly, API still may need to diff itself, but in most cases bots don't need it.