Page MenuHomePhabricator

Annotate redirects from prop=info if target is an interwiki
Closed, ResolvedPublic

Description

Take for example: https://en.wikipedia.org/w/api.php?format=xml&action=query&converttitles=&prop=info%7crevisions&intoken=edit&titles=User%3aReedy%2fRIW&inprop=protection%7cwatched%7cdisplaytitle&rvprop=content%7ctimestamp&redirects=&assert=user&meta=userinfo|notifications&uiprop=hasmsg&notprop=count

<query>
<redirects>
<r from="User:Reedy/RIW" to="de:User:Reedy"/>
</redirects>
<userinfo id="449918" name="Reedy"/>
<notifications rawcount="0" count="0"/>
</query>

It'd be really useful if the API could annotate if the target is an interwiki. There is nothing better than the local MW install at knowing what is a redirect on itself. Or, than being some extra attribute (like interwiki="true" or whatever), if we could extract and list the interwikis... Like we do elsewhere if we're given an interwiki title to open etc

https://en.wikipedia.org/w/api.php?format=xml&action=query&converttitles=&prop=info%7crevisions&intoken=edit&titles=De%3aFoobar&inprop=protection%7cwatched%7cdisplaytitle&rvprop=content%7ctimestamp&redirects=&assert=user&meta=userinfo|notifications&uiprop=hasmsg&notprop=count

<query>
<normalized>
<n from="De:Foobar" to="de:Foobar"/>
</normalized>
<interwiki>
<i title="de:Foobar" iw="de"/>
</interwiki>
<userinfo id="449918" name="Reedy"/>
<notifications rawcount="0" count="0"/>
</query>

Event Timeline

Reedy raised the priority of this task from to Needs Triage.
Reedy updated the task description. (Show Details)
Reedy added a project: MediaWiki-API.
Reedy added a subscriber: Reedy.
Reedy added a subscriber: Anomie.

Change 182081 had a related patch set uploaded (by Anomie):
API: Improve handling of interwiki redirects when resolving

https://gerrit.wikimedia.org/r/182081

Patch-For-Review

Change 182081 merged by jenkins-bot:
API: Improve handling of interwiki redirects when resolving

https://gerrit.wikimedia.org/r/182081

@Magioladitis: Can you file that separate bug as a new task here in Phabricator?

Thanks! That'll help the devs a ton.