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
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.
On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher brianna.laugher@gmail.com wrote:
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?
Has been a frequently requested feature, but is WONTFIX due to performance issues.
Bryan Tong Minh schreef:
On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher brianna.laugher@gmail.com wrote:
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?
Has been a frequently requested feature, but is WONTFIX due to performance issues.
The only thing we can provide from the API are wikidiff2's diffs (i.e. HTML diffs) which are pulled from the diff cache whenever possible. However, you can get these through index.php as well (forgot the exact parameters).
Roan Kattouw (Catrope)
2008/8/20 Roan Kattouw roan.kattouw@home.nl:
However, you can get these through index.php as well (forgot the exact parameters).
Something like http://en.wikipedia.org/w/index.php?action=render&diff=22245&oldid=2... would probably be the best choice. Defy that ugly view, CSS classes are still in code (in case you use the diff in on-page JS, don't forget to attach /skins-1.5/common/diff.css).
But as for me, taking two revisions from the API and diffing them was always more appropriate.
— Kalan
Kalan wrote:
2008/8/20 Roan Kattouw roan.kattouw@home.nl:
However, you can get these through index.php as well (forgot the exact parameters).
Something like http://en.wikipedia.org/w/index.php?action=render&diff=22245&oldid=2... would probably be the best choice. Defy that ugly view, CSS classes are still in code (in case you use the diff in on-page JS, don't forget to attach /skins-1.5/common/diff.css).
But as for me, taking two revisions from the API and diffing them was always more appropriate.
— Kalan
You mean http://en.wikipedia.org/w/index.php?action=render&diff=22245&oldid=2... :) Jsut remove anything between < >, undo the entities and you get a text-style diff
2008/8/20 Roan Kattouw roan.kattouw@home.nl:
The only thing we can provide from the API are wikidiff2's diffs (i.e. HTML diffs) which are pulled from the diff cache whenever possible. However, you can get these through index.php as well (forgot the exact parameters).
Sorry, what's a wikidiff2 diff and how is it different to the diff displayed to users?
Isn't (part of) the point of an API interface to avoid the need to screenscrape? Which is what you're doing if you're getting anything from index.php.... right?
Brianna
2008/8/20 Bryan Tong Minh bryan.tongminh@gmail.com:
On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher brianna.laugher@gmail.com wrote:
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?
Has been a frequently requested feature, but is WONTFIX due to performance issues.
Really? Is it in Bugzilla?
A couple of interesting bugs I found: https://bugzilla.wikimedia.org/show_bug.cgi?id=10268 "Watchlist RSS feed should include diffs" (marked RESOLVED, LATER which seems a bit weird to me?)
https://bugzilla.wikimedia.org/show_bug.cgi?id=3998 "support change-centric in addition to page-centric behavior mode for Recent Changes Atom feed"
- although this is not closed, I just had a look at en.wikipedia's RC feed, and it has coloured diffs in it, so maybe this bug can be closed.
Anyway I opened a new bug https://bugzilla.wikimedia.org/show_bug.cgi?id=15254 "Page history feeds should have diff view, like RecentChanges feed".
After thinking about it it makes the most sense to me that the (index.php) feeds should provide a diff view, and the API should not -- for machine purposes the pretty HTML diff is probably not much use.
However, it may be nice if the diff algorithm implementation was available as a kind of standalone implementation. Does anyone know much about it?
thanks, Brianna
On Thu, Aug 21, 2008 at 7:52 AM, Brianna Laugher brianna.laugher@gmail.com wrote:
2008/8/20 Bryan Tong Minh bryan.tongminh@gmail.com:
On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher brianna.laugher@gmail.com wrote:
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?
Has been a frequently requested feature, but is WONTFIX due to performance issues.
Really? Is it in Bugzilla?
https://bugzilla.wikimedia.org/show_bug.cgi?id=13209
"This bug was fixed once and then reverted because of performance issues."
A couple of interesting bugs I found: https://bugzilla.wikimedia.org/show_bug.cgi?id=10268 "Watchlist RSS feed should include diffs" (marked RESOLVED, LATER which seems a bit weird to me?)
https://bugzilla.wikimedia.org/show_bug.cgi?id=3998 "support change-centric in addition to page-centric behavior mode for Recent Changes Atom feed"
- although this is not closed, I just had a look at en.wikipedia's RC
feed, and it has coloured diffs in it, so maybe this bug can be closed.
Anyway I opened a new bug https://bugzilla.wikimedia.org/show_bug.cgi?id=15254 "Page history feeds should have diff view, like RecentChanges feed".
After thinking about it it makes the most sense to me that the (index.php) feeds should provide a diff view, and the API should not -- for machine purposes the pretty HTML diff is probably not much use.
However, it may be nice if the diff algorithm implementation was available as a kind of standalone implementation. Does anyone know much about it?
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/wikidiff2/
thanks, Brianna
-- They've just been waiting in a mountain for the right moment: http://modernthings.org/
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Bryan
mediawiki-api@lists.wikimedia.org