「ArchWiki:ボット」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(en:ArchWiki:Bots の版 588318 の状態に同期)
(セクション見出しの訳出・リンクの修正・状態テンプレートの除去(版 16124 での同期部分))
1行目: 1行目:
[[Category:ArchWiki]]
+
[[カテゴリ:ArchWiki]]
  +
[[en:ArchWiki:Bots]]
 
[[pt:ArchWiki:Bots]]
 
[[pt:ArchWiki:Bots]]
 
{{Related articles start}}
 
{{Related articles start}}
{{Related|Help:Procedures}}
+
{{Related|ヘルプ:操作手順}}
 
{{Related articles end}}
 
{{Related articles end}}
   
[[w:Bots|Bots]] are an important tool of the [[ArchWiki:Maintenance Team|maintenance team]], which allows to easily perform repetitive tasks ranging from daily routine to complicated one-shot updates. Bot edits constitute over 8% of all contributions to the wiki — all of these edits would have been very tedious to do manually.
+
[[w:Bots|Bots]] are an important tool of the [[ArchWiki:メンテナンスチーム|maintenance team]], which allows to easily perform repetitive tasks ranging from daily routine to complicated one-shot updates. Bot edits constitute over 8% of all contributions to the wiki — all of these edits would have been very tedious to do manually.
   
There is currently an active bot accounts:
+
There is currently an active bot account:
   
 
* [[User:Kusakata.bot2|kusakata.bot2]] (operated by [[User:Kusakata|kusakata]])
 
* [[User:Kusakata.bot2|kusakata.bot2]] (operated by [[User:Kusakata|kusakata]])
   
  +
== ソフトウェア ==
{{Expansion|Maybe add something like a policy regarding new bots?}}
 
   
  +
Bots use the [[mw:API:Main_page/ja|MediaWiki API]] to communicate with the wiki server. There are many bots developed by the [[Wikipedia:ja:ウィキメディア財団|Wikimedia Foundation]] using this API, but they are usually not general enough to work on other wikis or even conflict with our style guidelines. Therefore we have been working on our own ArchWiki-specific bot tools, which have the same flaws when evaluated by external parties.
== Software ==
 
 
Bots use the [[mw:API|MediaWiki API]] to communicate with the wiki server. There are many bots developed by the [[w:Wikimedia Foundation|Wikimedia Foundation]] using this API, but they are usually not general enough to work on other wikis or even conflict with our style guidelines. Therefore we have been working on our own ArchWiki-specific bot tools, which have the same flaws when evaluated by external parties.
 
   
 
=== Wiki Monkey ===
 
=== Wiki Monkey ===
   
The [https://github.com/kynikos/wiki-monkey Wiki Monkey] project's aim is to facilitate efficient editing by directly enhancing wiki pages in the web browser. It runs as a user script, allowing to execute repetitive tasks semi-automatically in article editor pages, or fully automatically from article-list pages such as [[Special:Categories|Categories]] or [[Special:WhatLinksHere|WhatLinksHere]]. Wiki Monkey also adds some helpers such as filters for [[Special:RecentChanges]] and [[Special:NewPages]]. See the [https://github.com/kynikos/wiki-monkey/wiki documentation] for details.
+
The [https://github.com/kynikos/wiki-monkey Wiki Monkey] project's aim is to facilitate efficient editing by directly enhancing wiki pages in the web browser. It runs as a user script, allowing to execute repetitive tasks semi-automatically in article editor pages, or fully automatically from article-list pages such as [[特別:カテゴリ|Categories]] or [[特別:リンク元|WhatLinksHere]]. Wiki Monkey also adds some helpers such as filters for [[特別:最近の更新]] and [[特別:新しいページ]]. See the [https://github.com/kynikos/wiki-monkey/wiki documentation] for details.
   
 
=== wiki-scripts ===
 
=== wiki-scripts ===
   
The [https://github.com/lahwaacz/wiki-scripts wiki-scripts] project contains many Python scripts built around a small library-like abstraction for the MediaWiki API. The purpose of the included scripts ranges from collecting information without editing the wiki to performing complex automated edits, which are described in [[#Tasks]]. Edits made by wiki-scripts, either automatically or interactively, are marked with the {{ic|wiki-scripts}} [[Special:Tags|tag]], which can be [https://wiki.archlinux.org/index.php?title=Special:RecentChanges&hidebots=0&tagfilter=wiki-scripts filtered] in the list of recent changes.
+
The [https://github.com/lahwaacz/wiki-scripts wiki-scripts] project contains many Python scripts built around a small library-like abstraction for the MediaWiki API. The purpose of the included scripts ranges from collecting information without editing the wiki to performing complex automated edits, which are described in [[#タスク]]. Edits made by wiki-scripts, either automatically or interactively, are marked with the {{ic|wiki-scripts}} [[特別:タグ一覧|tag]], which can be [https://wiki.archlinux.jp/index.php?title=特別:最近の更新&hidebots=0&tagfilter=wiki-scripts filtered] in the list of recent changes.
   
== Tasks ==
+
== タスク ==
   
This section describes the tasks that are repeatedly performed by ArchWiki bots. It serves as an overview and documentation of the features of operated bot scripts. Note that bot edits are by default hidden from [[Special:RecentChanges]], since their inclusion would make it far more difficult to follow and participate with regular contributions.
+
This section describes the tasks that are repeatedly performed by ArchWiki bots. It serves as an overview and documentation of the features of operated bot scripts. Note that bot edits are by default hidden from [[特別:最近の更新]], since their inclusion would make it far more difficult to follow and participate with regular contributions.
   
=== Double redirects ===
+
=== 二重リダイレクト ===
   
Fixing [[Help:Procedures#Fix_double_redirects|double redirects]] is the oldest automated task. It can be done for example with a [https://github.com/lahwaacz/wiki-scripts/blob/master/fix-double-redirects.py Python script] or [[#Wiki Monkey|Wiki Monkey]]'s dedicated plugin.
+
Fixing [[ヘルプ:操作手順#二重リダイレクトを修正する|double redirects]] is the oldest automated task. It can be done for example with a [https://github.com/lahwaacz/wiki-scripts/blob/master/fix-double-redirects.py Python script] or [[#Wiki Monkey|Wiki Monkey]]'s dedicated plugin.
   
=== Table of contents ===
+
=== 目次 ===
   
The [[Table of contents]] page and its "translations" are maintained by using the [https://github.com/lahwaacz/wiki-scripts/blob/master/toc.py toc.py] script. The script can be run daily, its execution takes couple of seconds.
+
The [[目次]] page and its "translations" are maintained by using the [https://github.com/lahwaacz/wiki-scripts/blob/master/toc.py toc.py] script. The script can be run daily, its execution takes couple of seconds.
   
 
The script assumes the following entry point to be present on the page:
 
The script assumes the following entry point to be present on the page:
47行目: 46行目:
 
The content of this table is replaced with an updated version generated by the script, the rest of the page is left intact. The script recognizes the following optional attributes for configuration:
 
The content of this table is replaced with an updated version generated by the script, the rest of the page is left intact. The script recognizes the following optional attributes for configuration:
   
* {{ic|data-toc-languages}} specifies the languages to be shown on the page. It is a comma-separated list of language tags, at most 2 can be specified. Defaults to the language of the current page, i.e. {{ic|ru}} for [[Table of contents (Русский)]].
+
* {{ic|data-toc-languages}} specifies the languages to be shown on the page. It is a comma-separated list of language tags, at most 2 can be specified. Defaults to the language of the current page, i.e. {{ic|ru}} for [[:en:Table of contents (Русский)]].
 
* {{ic|data-toc-alsoin}} specifies the translation of the "also in" phrase. The format is {{ic|''tag1:text, tag2:text, ...''}}.
 
* {{ic|data-toc-alsoin}} specifies the translation of the "also in" phrase. The format is {{ic|''tag1:text, tag2:text, ...''}}.
   
For example (from [[Table of contents (Русский)]]):
+
For example (from [[:en:Table of contents (Русский)]]):
   
 
{{bc|<nowiki>
 
{{bc|<nowiki>
60行目: 59行目:
 
Users can also translate the category names in the table by editing the links on the wiki page and the script will preserve them on updates.
 
Users can also translate the category names in the table by editing the links on the wiki page and the script will preserve them on updates.
   
=== Statistics ===
+
=== 統計 ===
   
The [[ArchWiki:Statistics]] page is maintained by the [https://github.com/lahwaacz/wiki-scripts/blob/master/statistics.py statistics.py] script. Currently only the [[ArchWiki:Statistics#User_statistics|User statistics]] section is autogenerated, the rest is updated manually. The update takes about 15 seconds and should be run daily.
+
The [[ArchWiki:統計]] page is maintained by the [https://github.com/lahwaacz/wiki-scripts/blob/master/statistics.py statistics.py] script. Currently only the [[:en:ArchWiki:Statistics#User_statistics|User statistics]] section is autogenerated, the rest is updated manually. The update takes about 15 seconds and should be run daily.
   
 
The script works by obtaining metadata of all revisions and user accounts from the API and caching it locally for better performance. The edit counts are determined by manually counting user contributions without relying on MediaWiki counters.
 
The script works by obtaining metadata of all revisions and user accounts from the API and caching it locally for better performance. The edit counts are determined by manually counting user contributions without relying on MediaWiki counters.
   
{{Note|Some improvements are discussed in [[ArchWiki talk:Statistics#Improvements]].}}
+
{{Note|Some improvements are discussed in [[:en:ArchWiki talk:Statistics#Improvements]].}}
   
  +
=== パッケージテンプレート ===
=== Package templates ===
 
   
The [https://github.com/lahwaacz/wiki-scripts/blob/master/update-package-templates.py update-package-templates.py] script parses the content of all pages and updates the [[Template:Pkg|Pkg]], [[Template:Grp|Grp]] and [[Template:AUR|AUR]] templates. The package name is actually not changed by the script, but e.g. for packages that have been recently moved from AUR to the official repositories, the link is updated from [[Template:AUR]] to [[Template:Pkg]]. Invalid package links are marked with [[Template:Broken package link]] along with a sometimes useful hint showing the package status.
+
The [https://github.com/lahwaacz/wiki-scripts/blob/master/update-package-templates.py update-package-templates.py] script parses the content of all pages and updates the [[テンプレート:Pkg|Pkg]], [[テンプレート:Grp|Grp]] and [[テンプレート:AUR|AUR]] templates. The package name is actually not changed by the script, but e.g. for packages that have been recently moved from AUR to the official repositories, the link is updated from [[テンプレート:AUR]] to [[テンプレート:Pkg]]. Invalid package links are marked with [[テンプレート:Broken package link]] along with a sometimes useful hint showing the package status.
   
The script uses localized versions of [[Template:Broken package link]] and [[Template:aur-mirror]] when they exist and falls back to the English versions. Other than that there is no server-side configuration.
+
The script uses localized versions of [[テンプレート:Broken package link]] and [[テンプレート:aur-mirror]] when they exist and falls back to the English versions. Other than that there is no server-side configuration.
   
After each run, but at most once per 7 days, the script creates a detailed report of broken links at [[User:Lahwaacz.bot/Reports/archpkgs]].
+
After each run, but at most once per 7 days, the script creates a detailed report of broken links at [[:en:User:Lahwaacz.bot/Reports/archpkgs]].
   
=== Interlanguage ===
+
=== 言語間リンク ===
   
 
The [https://github.com/lahwaacz/wiki-scripts/blob/master/interlanguage.py interlanguage.py] script does the following:
 
The [https://github.com/lahwaacz/wiki-scripts/blob/master/interlanguage.py interlanguage.py] script does the following:
82行目: 81行目:
 
* Checks if the language of categories assigned to each page matches the language of the page itself.
 
* Checks if the language of categories assigned to each page matches the language of the page itself.
 
* Creates missing localized categories, mirroring the English category tree.
 
* Creates missing localized categories, mirroring the English category tree.
* Updates the [[Help:I18n#Interlanguage_links|interlanguage links]] on all content pages using [http://lahwaacz.github.io/wiki-scripts/ws/ws.interlanguage.InterlanguageLinks.html this algorithm].
+
* Updates the [[Help:I18n#言語間リンク|interlanguage links]] on all content pages using [http://lahwaacz.github.io/wiki-scripts/ws/ws.interlanguage.InterlanguageLinks.html this algorithm].
   
 
The execution time depends on the amount of updates, it is usually less than a minute and about 30 seconds when there are no updates.
 
The execution time depends on the amount of updates, it is usually less than a minute and about 30 seconds when there are no updates.
 
=== Link checker ===
 
 
{{Expansion|TBA}}
 
 
== Future tasks ==
 
 
{{Expansion|A list of things that we haven't had the time to implement yet, might be useful for people that would like to contribute.}}
 

2020年4月28日 (火) 11:20時点における版

関連記事

Bots are an important tool of the maintenance team, which allows to easily perform repetitive tasks ranging from daily routine to complicated one-shot updates. Bot edits constitute over 8% of all contributions to the wiki — all of these edits would have been very tedious to do manually.

There is currently an active bot account:

ソフトウェア

Bots use the MediaWiki API to communicate with the wiki server. There are many bots developed by the Wikimedia Foundation using this API, but they are usually not general enough to work on other wikis or even conflict with our style guidelines. Therefore we have been working on our own ArchWiki-specific bot tools, which have the same flaws when evaluated by external parties.

Wiki Monkey

The Wiki Monkey project's aim is to facilitate efficient editing by directly enhancing wiki pages in the web browser. It runs as a user script, allowing to execute repetitive tasks semi-automatically in article editor pages, or fully automatically from article-list pages such as Categories or WhatLinksHere. Wiki Monkey also adds some helpers such as filters for 特別:最近の更新 and 特別:新しいページ. See the documentation for details.

wiki-scripts

The wiki-scripts project contains many Python scripts built around a small library-like abstraction for the MediaWiki API. The purpose of the included scripts ranges from collecting information without editing the wiki to performing complex automated edits, which are described in #タスク. Edits made by wiki-scripts, either automatically or interactively, are marked with the wiki-scripts tag, which can be filtered in the list of recent changes.

タスク

This section describes the tasks that are repeatedly performed by ArchWiki bots. It serves as an overview and documentation of the features of operated bot scripts. Note that bot edits are by default hidden from 特別:最近の更新, since their inclusion would make it far more difficult to follow and participate with regular contributions.

二重リダイレクト

Fixing double redirects is the oldest automated task. It can be done for example with a Python script or Wiki Monkey's dedicated plugin.

目次

The 目次 page and its "translations" are maintained by using the toc.py script. The script can be run daily, its execution takes couple of seconds.

The script assumes the following entry point to be present on the page:

{| id="wiki-scripts-toc-table"
...
|}

The content of this table is replaced with an updated version generated by the script, the rest of the page is left intact. The script recognizes the following optional attributes for configuration:

  • data-toc-languages specifies the languages to be shown on the page. It is a comma-separated list of language tags, at most 2 can be specified. Defaults to the language of the current page, i.e. ru for en:Table of contents (Русский).
  • data-toc-alsoin specifies the translation of the "also in" phrase. The format is tag1:text, tag2:text, ....

For example (from en:Table of contents (Русский)):

{| id="wiki-scripts-toc-table" data-toc-languages="ru,en" data-toc-alsoin="ru:Также в"
...
|}

Users can also translate the category names in the table by editing the links on the wiki page and the script will preserve them on updates.

統計

The ArchWiki:統計 page is maintained by the statistics.py script. Currently only the User statistics section is autogenerated, the rest is updated manually. The update takes about 15 seconds and should be run daily.

The script works by obtaining metadata of all revisions and user accounts from the API and caching it locally for better performance. The edit counts are determined by manually counting user contributions without relying on MediaWiki counters.

ノート: Some improvements are discussed in en:ArchWiki talk:Statistics#Improvements.

パッケージテンプレート

The update-package-templates.py script parses the content of all pages and updates the Pkg, Grp and AUR templates. The package name is actually not changed by the script, but e.g. for packages that have been recently moved from AUR to the official repositories, the link is updated from テンプレート:AUR to テンプレート:Pkg. Invalid package links are marked with テンプレート:Broken package link along with a sometimes useful hint showing the package status.

The script uses localized versions of テンプレート:Broken package link and テンプレート:aur-mirror when they exist and falls back to the English versions. Other than that there is no server-side configuration.

After each run, but at most once per 7 days, the script creates a detailed report of broken links at en:User:Lahwaacz.bot/Reports/archpkgs.

言語間リンク

The interlanguage.py script does the following:

  • Checks if the language of categories assigned to each page matches the language of the page itself.
  • Creates missing localized categories, mirroring the English category tree.
  • Updates the interlanguage links on all content pages using this algorithm.

The execution time depends on the amount of updates, it is usually less than a minute and about 30 seconds when there are no updates.