Skip to content

Commit

Permalink
Update docs for canonical instance URL
Browse files Browse the repository at this point in the history
  • Loading branch information
wetneb committed Sep 17, 2024
1 parent 0e3ab5b commit 601d95a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ have been designed and implemented in the same go. This means they work in the s
in EditGroups has a machine-readable counterpart. This can be accessed either by prepending ``/api/`` to
the URL, or by using `content negociation <https://en.wikipedia.org/wiki/Content_negotiation>`_.

For instance, the page `https://tools.wmflabs.org/editgroups/b/OR/cf1b2a01a/ <https://tools.wmflabs.org/editgroups/b/OR/cf1b2a01a/>`_
can be obtained in a JSON format at `https://tools.wmflabs.org/editgroups/api/b/OR/cf1b2a01a/ <https://tools.wmflabs.org/editgroups/b/OR/cf1b2a01a/>`_, or by adding the appropriate header::
For instance, the page `https://editgroups.toolforge.org/b/OR/cf1b2a01a/ <https://editgroups.toolforge.org/b/OR/cf1b2a01a/>`_
can be obtained in a JSON format at `https://editgroups.toolforge.org/api/b/OR/cf1b2a01a/ <https://editgroups.toolforge.org/b/OR/cf1b2a01a/>`_, or by adding the appropriate header::

curl -H "Accept: application/json" https://tools.wmflabs.org/editgroups/b/OR/cf1b2a01a/
curl -H "Accept: application/json" https://editgroups.toolforge.org/b/OR/cf1b2a01a/

Each API endpoint supports the same parameters as its HTML counterpart. For instance, the main page
lists the most recent edit groups and can be accessed as an API as well, at https://tools.wmflabs.org/editgroups/api/.
lists the most recent edit groups and can be accessed as an API as well, at https://editgroups.toolforge.org/api/.

When viewing API pages in a browser, Django Rest Framework automatically adds an HTML wrapper around the API output.
When querying the same URI in a script, only the JSON API output will be required (no ``Accept`` header required).
Expand All @@ -30,6 +30,6 @@ Reverting batches via the API

To revert batches through EditGroups, you will need to login to EditGroups via OAuth and store the corresponding
authentication cookies. Reverting itself is done by posting a POST request to the ``/undo/start/`` subpage of a batch
page, such as ``https://tools.wmflabs.org/editgroups/b/OR/cf1b2a01a/undo/start/``, with the ``comment`` parameter
page, such as ``https://editgroups.toolforge.org/b/OR/cf1b2a01a/undo/start/``, with the ``comment`` parameter
to indicate an edit summary for the reverting group.

2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To add a tool, go to ``http://localhost:8000/admin/store/tool/`` and click **Add
to fill in the following fields:

- **Name**: the name of the tool, displayed in the interface
- **Shortid**: a short identifier for the tool, used in the URLs for its batches. For instance, ``OR`` is the short id for OpenRefine in the Wikidata instance, which can be seen in URLs such as ``https://tools.wmflabs.org/editgroups/b/OR/28d99182/``;
- **Shortid**: a short identifier for the tool, used in the URLs for its batches. For instance, ``OR`` is the short id for OpenRefine in the Wikidata instance, which can be seen in URLs such as ``https://editgroups.toolforge.org/b/OR/28d99182/``;
- **Idregex**: a Python regular expression which captures the batch identifier in the edit summary. The batch identifier must be captured by a group. For instance you could use ``.*editgroups/b/OR/([a-f0-9]{4,32})\|details\]\]\).*`` for OpenRefine.
- **Idgroupid**: the numerical identifier of the group to extract from the regex above to obtain the batch identifier (1 in the example above)
- **Summaryregex**: a Python regular expression which captures the batch summary from the edit summary. Again a group must capture the relevant part to extract.
Expand Down
2 changes: 1 addition & 1 deletion docs/other_wiki.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Configuration of the tools

The regular expressions used to detect batch identifiers and tools in edits are considered user data
and are therefore stored in their own SQL table. They can be configured from EditGroups' admin interface
(which uses Django's standard admin functionality), available on the canonical instance at https://tools.wmflabs.org/editgroups/admin/.
(which uses Django's standard admin functionality), available on the canonical instance at https://editgroups.toolforge.org/admin/.

To access this interface, you need to create an administrator account in EditGroups using the ``python manage.py createsuperuser`` command. Being an administrator on the target wiki does not automatically grant you rights to administer EditGroups.

0 comments on commit 601d95a

Please sign in to comment.