Commons talk:Edit groups/Adding a tool
Adding QuickCategories support
[edit]@Pintoch: Would you mind adding support for QuickCategories? The tool already assigns an identifier to each batch (decimal number) and includes it in each edit summary (example edit), so it should be possible to match the edit summaries (of batches targeting Commons, at least) without any changes. And while the link in the summary goes to the QuickCategories tool, not to the edit groups tool, I could then add a link to the corresponding edit group on the QuickCategories batch page.
I’m not sure in which exact format you want the regular expression(s), but I think the Python re ^[^;]*; (.*) \(\[\[toolforge:quickcategories/batch/([0-9][1-9]*)/|QuickCategories batch #\1\]\]\)$
captures the summary in 1 and the batch ID in 2 for batches that have a custom summary, while ^[^;]*; \[\[toolforge:quickcategories/batch/([0-9][1-9]*)/|QuickCategories batch #\1\]\]$
captures the batch ID in 1 for batches that don’t have a custom summary. (Could be combined into one pattern, but only by repeating the link part, I think, so I thought it would be easier to give the two patterns separately for now.) Lucas Werkmeister (talk) 21:57, 13 September 2021 (UTC)
- Once you have the batch ID, you can also get the summary out of the JSON metadata (example), but I’m guessing you don’t want to include that much tool-specific code. Lucas Werkmeister (talk) 22:27, 13 September 2021 (UTC)
- @Lucas Werkmeister: Thanks! I have added the integration and it seems to work. Yes it would be more reliable to use your API to extract the summary, but indeed I haven't built support for that so far (but it's worth keeping in mind if other tools offer a similar feature). Also, I realize your tool works on all Wikimedia wikis, so it's a bit sad I went for the lazy route of only making a Commons-specific instance rather than making one instance which supports all Wikimedia wikis at once (which would be a bit more work since it means making changes to the data model). My motivation for doing one instance of the tool per wiki is that I would still like to make it possible to run the tool for non-Wikimedia wikis (so, by polling recent changes, probably) and then it's a bit weird if the tool is designed for multiple wikis but is only run against one. − Pintoch (talk) 06:40, 14 September 2021 (UTC)
- @Pintoch cool, thanks! toolforge:quickcategories/batch/3884/ links to the edit group now :) Lucas Werkmeister (talk) 20:44, 14 September 2021 (UTC)
- @Lucas Werkmeister: Thanks! I have added the integration and it seems to work. Yes it would be more reliable to use your API to extract the summary, but indeed I haven't built support for that so far (but it's worth keeping in mind if other tools offer a similar feature). Also, I realize your tool works on all Wikimedia wikis, so it's a bit sad I went for the lazy route of only making a Commons-specific instance rather than making one instance which supports all Wikimedia wikis at once (which would be a bit more work since it means making changes to the data model). My motivation for doing one instance of the tool per wiki is that I would still like to make it possible to run the tool for non-Wikimedia wikis (so, by polling recent changes, probably) and then it's a bit weird if the tool is designed for multiple wikis but is only run against one. − Pintoch (talk) 06:40, 14 September 2021 (UTC)