Page MenuHomePhabricator

Expose "actual watchers" as in "action=info" via API call {action: query, prop: info}
Closed, ResolvedPublic

Description

this is a recently (as in 1.26wmf13) added enhancement to action=query, which is not yet available via API.
the field is called "visitedWatchers", and should probably require both new inprop value, as well as output field.

see T51506.

peace.

Event Timeline

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

This metric will help me generate a more meaningful WikiProject Watchers report https://en.wikipedia.org/wiki/Wikipedia:Database_reports/WikiProject_watchers

Further, having this information will help me evaluate the outcomes of my WikiProject work – using raw watchers is an unreliable metric, since some WikiProjects are several years old and have watchers who haven't edited in years.

Therefore, I would be happy to see "actual watcher" information exposed via the API. Thank you.

MZMcBride added a project: good first task.
MZMcBride set Security to None.
MZMcBride subscribed.

whoever closes this ticket - i think it may be good idea to redefine it as:

all data available via

action=info

should be available via api call

action=query&prop=info

whenever possible.
this will add a bunch of new "inprop" values, and should not affect any existing code not using those new values.

peace.

Looking through it:

  • "Redirect target" is T31115.
  • "Default sort key" could be added easily enough, although when it's non-default it's already available from &prop=pageprops as 'defaultsort'.
  • "Page ID" isn't necessary from prop=info, since it's automatically returned by action=query itself.
  • "Indexing by robots" could be added, although it would have to duplicate much of the logic from Article::getRobotPolicy() to avoid having to instantiate 5000 Article objects.
  • "Number of redirects to this page" I'm not sure is terribly useful, if someone cares they could probably do better using prop=redirects.
  • "Counted as a content page" could be difficult to do efficiently since it requires loading the Content object.
  • "Number of subpages of this page" I'm not sure is terribly useful, if someone cares they could probably do better using list=allpages&apprefix=... (if meta=siteinfo reports the namespace has subpages enabled).
  • Category information is available from prop=categoryinfo.
  • Most of the edit history stuff is likely better done with prop=revisions. Total authors is prop=contributors. Recent bits, probably list=recentchanges&rctitle=...
  • "Magic words" are in prop=pageprops.
  • "Hidden categories" are prop=categories.
  • "Transcluded templates" is prop=templates.
  • "Pages transcluded on" is prop=transcludedin.
  • A hook parallel to 'InfoAction' could be useful, although some of it (e.g. the page image) are better done via their existing prop modules (e.g. prop=pageimage).

Change 263162 had a related patch set uploaded (by Sn1per):
Expose visitedwatchers to API through action=query&prop=info

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

Change 263162 merged by jenkins-bot:
Expose visitingwatchers to API through action=query&prop=info

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

Change 274966 had a related patch set uploaded (by Krinkle):
api: Avoid bad query when $unwatchedPageThreshold is not set

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

Change 274966 abandoned by Krinkle:
api: Avoid bad query when $unwatchedPageThreshold is not set

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