Manual:Bots/zh


 * 参见API:客户端代码

机器人是一种可用于执行与维基相关的繁琐工作或某些重复性任务的自动化工具. 一个 可以在IRC频道上发布您对wiki的最新更改. WP:CREATEBOT页面上有用不同语言编写的机器人框架，它们可以通过API来编辑维基. 机器人每小时或每分钟可以进行数百甚至数千次编辑，导致“最近更改”页面可能被机器人的修改占满，所以 user rights应该配置为允许机器人获得特殊的用户权限，使它们的编辑记录不在“最近更改”中出现. 由于这可能会导致大量的错误，或恶意的机器人编辑被长时间忽视，因此这种权利应仅限于受信任的用户操作的机器人.

机器人可用于有益目的，例如修复双重重定向，或用于有害目的，例如人为破坏和垃圾邮件（另请参阅）.

The 'bot' permission may also be temporarily granted to human editors flooding Recent Changes (e.g. using AutoWikiBrowser). On Wikimedia Foundation wikis, the 'flooder' or 'flood' flag gives non-bot users the 'bot' permission.

机器人权限、用户组与标记

 * 来自2012年9月wikitech-l讨论串

“机器人”用户权限
This is the right that grants the user the ability to perform an edit with a "bot" flag.

实例：


 * 不是所有拥有该权限的用户都是“机器人”.
 * The flag can be toggled on a per-edit basis. Bot software will activate this flag. But an account can be used by humans and bot software simultaneously. A dedicated bot account will typically have all its edits bot-flagged, but other users may contribute regularly and also run a bot from time to time with their credentials.

The "bot" user group
This user group is available in MediaWiki by default to grant a user the bot right (because user management goes by groups, not rights. To grant a user the bot right, one adds the user to a group that provides that right).

Facts:


 * Group membership can change over time. There are many bot-flagged edits by users that are no longer in a user group providing the bot right. Likewise there are many edits not bot-flagged by users that now have the bot right (which they may or may not use for each edit).
 * Not all bots are a member of this group (there are other groups that provide this right, sysop, for example).

The "bot" flag
This is the only reliable factor. This indicates most accurately that the edit was intended as bot edit (and that the user could do so because they had the bot user right when the edit was made).

It is especially reliable because the data is stored with the edit, not calculated afterwards, so it isn't affected by the user's group memberships at query time.

However it has one catch: The data is only stored in the recentchanges table, from which it expires after 30 days. This may be why this best way is also the least common way to categorize bot edits in analytics (unless only covering recent data).

The bot flag could/should be stored in the revision table, thus making it permanently available.