Page MenuHomePhabricator

[Citation bot] Create a web API for Citation bot that returns expanded wikitext [AOI]
Closed, ResolvedPublic5 Estimated Story Points

Description

Change how https://en.wikipedia.org/wiki/MediaWiki:Gadget-citations.js works so that it makes an API request to the Tool Labs code rather than using a click-jacking hack.

Change the backend code to Citation bot so that there is an appropriate web API to contact. It's probably best to write a new script to handle this; doibot.php is close in functionality and is a sort of API, but the script is mixed up with the page output and won't be easy to add to. The basic logic of this should be easy, while the surrounding code to set this up may be a bit trickier.

Acceptance criteria:

  • https://tools.wmflabs.org/citations/ has an API endpoint set up to work with a JS XHR request from the on-wiki gadget, with whatever is needed to make same-origin controls work.
  • The new API has a method that takes the page title as input and returns the expanded wikitext and the edit summary.
  • There are unit tests and documentation.

Event Timeline

Fhocutt raised the priority of this task from to Low.
Fhocutt updated the task description. (Show Details)
DannyH renamed this task from [AOI][Citation bot] Create a web API for Citation bot that returns expanded wikitext to CB4. [AOI][Citation bot] Create a web API for Citation bot that returns expanded wikitext.Oct 27 2015, 5:39 PM
DannyH set Security to None.
DannyH raised the priority of this task from Low to Medium.Oct 28 2015, 4:43 PM
DannyH edited a custom field.
DannyH renamed this task from CB4. [AOI][Citation bot] Create a web API for Citation bot that returns expanded wikitext to [Citation bot] Create a web API for Citation bot that returns expanded wikitext [AOI].Oct 28 2015, 7:05 PM

Could use a bit of refactoring, but works for this minimal case.

DannyH moved this task from Q3 2018-19 to Q1 2018-19 on the Community-Tech-Sprint board.
DannyH subscribed.