Get diffs?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Get diffs?

Brianna Laugher
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

--
They've just been waiting in a mountain for the right moment:
http://modernthings.org/

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Max Semenik
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.

--
Best regards,
  Max Semenik ([[User:MaxSem]])


_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Bryan Tong Minh
In reply to this post by Brianna Laugher
On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher
<[hidden email]> 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.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Roan Kattouw
Bryan Tong Minh schreef:

> On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher
> <[hidden email]> 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)

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

KALAN-4
2008/8/20 Roan Kattouw <[hidden email]>:
> 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=22222
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
_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Platonides
Kalan wrote:

> 2008/8/20 Roan Kattouw <[hidden email]>:
>> 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=22222
> 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=22222&diffonly=1 
:)
Jsut remove anything between < >, undo the entities and you get a
text-style diff

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Brianna Laugher
In reply to this post by Roan Kattouw
2008/8/20 Roan Kattouw <[hidden email]>:
> 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

--
They've just been waiting in a mountain for the right moment:
http://modernthings.org/

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Brianna Laugher
In reply to this post by Bryan Tong Minh
2008/8/20 Bryan Tong Minh <[hidden email]>:
> On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher
> <[hidden email]> 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

--
They've just been waiting in a mountain for the right moment:
http://modernthings.org/

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Get diffs?

Bryan Tong Minh
On Thu, Aug 21, 2008 at 7:52 AM, Brianna Laugher
<[hidden email]> wrote:

> 2008/8/20 Bryan Tong Minh <[hidden email]>:
>> On Wed, Aug 20, 2008 at 8:55 AM, Brianna Laugher
>> <[hidden email]> 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
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>

Bryan

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api