tpt-target-page : how to anticipate it for API:Edit ?

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

tpt-target-page : how to anticipate it for API:Edit ?

Nicolas Vervelle-4
Hello,

I'm trying to add Meta as a wiki in my tool, WPCleaner.
Meta has differences with the usual languages wikis, like the fact that a page can have translations. Such translations are handled by Extension:Translate, which prevents updating the translated pages through API:Edit (getting error tpt-target-page when trying to update such page).

How can I know before using API:Edit that it will not work?
If possible, when retrieving basic information about the page (like API:Query:Info).

My need is to skip such pages (avoid getting their content and working on them) for the moment.

Nico

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

Re: tpt-target-page : how to anticipate it for API:Edit ?

Bartosz Dziewoński
On 2020-06-07 15:30, Nicolas Vervelle wrote:

> Hello,
>
> I'm trying to add Meta as a wiki in my tool, WPCleaner.
> Meta has differences with the usual languages wikis, like the fact that
> a page can have translations. Such translations are handled by
> Extension:Translate, which prevents updating the translated pages
> through API:Edit (getting error tpt-target-page when trying to update
> such page).
>
> How can I know before using API:Edit that it will not work?
> If possible, when retrieving basic information about the page (like
> API:Query:Info).
>
> My need is to skip such pages (avoid getting their content and working
> on them) for the moment.

You can do this with prop=info&intestactions=edit, for example:

https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=info&titles=Mission%7CMission%2Fpl&intestactions=edit&intestactionsdetail=full


--
Bartosz Dziewoński

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

Re: tpt-target-page : how to anticipate it for API:Edit ?

Nicolas Vervelle-4
Thanks Bartosz !

That works for me.

Nico

On Mon, Jun 8, 2020 at 5:37 PM Bartosz Dziewoński <[hidden email]> wrote:
On 2020-06-07 15:30, Nicolas Vervelle wrote:
> Hello,
>
> I'm trying to add Meta as a wiki in my tool, WPCleaner.
> Meta has differences with the usual languages wikis, like the fact that
> a page can have translations. Such translations are handled by
> Extension:Translate, which prevents updating the translated pages
> through API:Edit (getting error tpt-target-page when trying to update
> such page).
>
> How can I know before using API:Edit that it will not work?
> If possible, when retrieving basic information about the page (like
> API:Query:Info).
>
> My need is to skip such pages (avoid getting their content and working
> on them) for the moment.

You can do this with prop=info&intestactions=edit, for example:

https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=info&titles=Mission%7CMission%2Fpl&intestactions=edit&intestactionsdetail=full


--
Bartosz Dziewoński

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

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