Wikipedia:AutoWikiBrowser/Kingbotk plugin
This page is currently inactive and is retained for historical reference. Either the page is no longer relevant or consensus on its purpose has become unclear. To revive discussion, seek broader input via a forum such as the village pump. |
Kingbotk Plugin for AWB | |||||
---|---|---|---|---|---|
Home
General information about the Kingbotk Plugin and directions for installation. |
Discussion
Discuss the application and ask questions. |
User guide
What the plugin does, how it works, and why you should use it. |
AutoWikiBrowser
The plugin works inside AWB and is shipped with that tool. | ||
Generic WikiProject templates · WikiFunctions2.dll · AWB Plugins · AWB Sandbox |
The Kingbotk plugin is a set of AutoWikiBrowser plugins written by Kingboyk in VB.NET and used by various automated bot accounts including Kingbotk. The plugin also provides features to assist article reviewers, and ships with a reusable library of functions and objects for use by programmers.
Magioladitis and Reedy rewrote the plugin's code in C#.
News
editAs of version 2.0, which was released with v4.2 of AWB, the Kingbotk Plugin supports {{WikiProjectBannerShell}} and {{WikiProjectBanners}}:
- Existing WikiProject templates will always be written back into the shell container it came from if we detect one
- New WikiProject templates will be written into the existing {{WikiProjectBannerShell}} or {{WikiProjectBanners}} template
As originally designed, when a page is being processed each active templating plugin (WPBiography, WikiProject Albums etc.) gets called by the Kingbotk Plugin Manager and decides if it has any edits to make (and templating plugins which the user hasn't enabled aren't called at all). If every active templating plugin decides it has no work to do we never get to the part of the code where we write out templates and examine their position on the page. If folks find the cleanup features useful I might do some restructuring later on to have the Plugin Manager, the Article object we create for each page, or the first active templating plugin, examine the page for these templates before doing anything else (so we never skip a page where we could clean a template). I might also consider allowing the WPBio plugin or the plugin manager to examine the page for WPBiography|living=yes even if we're not going to be writing one of those templates. However, I felt it more important to get this feature out and tested than start breaking apart the internal structure of the plugin, a structure which allows for new plugins to be added easily and which is a very nice OOP model.
Downloading and using the plugin
edit- The plugin is supplied with AWB, which can be downloaded here
- We have a user guide
- As of May 2008 the plugin is licenced under the GNU General Public Licence Version 2.0
- Source code can be retrieved by pointing your Subversion client here
Warning and disclaimer
edit- This tool is released as is and without warranty. You are RESPONSIBLE FOR YOUR OWN EDITS.
- AWB and this plugin are both very powerful tools. You should familiarise yourself fully with the guidelines, instructions and operation of both tools before using them.
- Ensure you have the latest version, or that any upgrades/changes in newer versions don't apply to you.
- Instructions for automated use with a bot account:
- The above guidelines doubly apply when doing automated edits, particularly making sure you understand what the plugin does and doesn't do.
- The template tagging feature is extremely well tested, but sometimes new internal changes introduce the risk of something breaking or a new bug. Always run a manual test if a version's release notes says it includes such changes. The author runs tests too but can't test for every eventuality and relies to an extent on the users to test.
- Before using a new template plugin do a few manual edits first. Some template plugins (WPBio, WPMilHist, WPAustralia, Generic) are very well tested; others might never have been used.
- If you've run successful tests on a new version or found a bug please post on the talk page asap.
Specification
editThis plugin comes with several WikiProject-specific tools:
Templating plugins
editAll templating plugins:
- Work together. Multiple plugins can be active at the same time to allow tagging for more than one project.
- Have optional user configurable parameters
- Use safe, well tested regular expressions to avoid double tagging, recognise badly formatted tags, and safely integrate new parameters into existing templates
WPBiography plugin
editAs of version 2.3.1.2
- If {{WikiProject Biography}} is missing, it adds it
- The importance= parameter is removed
- Living=yes is optionally added/replaced if missing or =no
- {{reqphoto}} is replaced with needs-photo=yes
- listas= is calculated and added if no DEFAULTSORT key is present (manual mode only; there are too many variations in human naming for this to be done by bots)
- The template call is reformatted and (if living=yes) moved to the top of the talk page unless a shell like {{WikiProjectBannerShell}} is present (template will be left in situ, or written to the top if new. Plugin doesn't yet write new templates into these containers or otherwise reformat them).
- Marks parameter and template renaming as minor edits, parameter value changes as major
Albums plugin
edit- If {{WikiProject Albums}} is missing, it adds it
Australia plugin
edit- If {{WikiProject Australia}} is missing, it adds it
India plugin
edit- If {{WikiProject India}} is missing, it adds it
- {{reqphoto}} is replaced with image-needed=yes
Military History plugin
edit- If {{WikiProject Military history}} is missing, it adds it
Novels plugin
edit- If {{WikiProject Novels}} is missing, it adds it
- Marks parameter and template renaming as minor edits, parameter value changes as major
- {{reqphoto}} is replaced with needs-infobox-cover=yes
Songs plugin
edit- If {{WikiProject Songs}} is missing, it adds it
- {{Single infobox request}} is replaced with needs-infobox=yes
Generic templates plugin
edit- If your WikiProject's template is "generic" (you have a class= parameter and no workgroups, and no need for other customised programatic logic) the plugin now supports your template! Simply enter the name of the template in brackets, any alternate names (redirects), and click a few boxes to configure the plugin. See Generic WikiProject templates for more information.
Note that even if your Project's template has workgroups, you can use the plugin on talk pages/categories which don't need a new workgroup parameter to be added. The plugin doesn't remove parameters it has no knowledge of; rather, if your Project doesn't have a specific plugin you simply won't be able to add such parameters.
Wikipedia Assessments plugin
edit- Loads and optionally cleans articles, then prompts user to (p)review the article
- Presents reviewer with an assessment form, with checkbox options for class, importance, etc.
Todo
editVersion 4++
edit- Given the rate of change of WikiProject templates, we may need to consider extending the "generic template" functionality to include adding/changing/removing user-configurable template parameters. Instead of developing plugins for each template, WikiProjects would be encouraged to build and share their own XML settings files. Possibly some WikiProjects will need programatic support still, if the plugin needs to apply more advanced logic to their templating, but I think most won't.
- Do we want to have the plugin (via AWB?) load the article and look for stub and infobox templates?
Manual assessment
edit- Look at whether it would be practical/desirable to have extra params/templates on the manual assessments popup form (per Talk)
Other planned changes
edit- The todo comments in code
- Consider controlling length of edit summaries by using a generic collection of important/unimportant edit summary items, and deciding on which to use at the end of processing the article (currently large category names, more than one template at a time, or multiple parameters are causing the edit summary to get chopped).
Possible future enhancements
edit- Sanity-check parameter values and (in bot mode) log any which need manual inspection. Currently the plugin just ignores parms and values it doesn't know about, and only logs badly misformed tags (those which break its main regular expression).
Bot
edit- In the longer term, plugins could be used to make AWB more of a bot. Save talk page lists in a database, periodically scan categories and compare against the WPBio living persons category/transclusions. Bot manager, predefined jobs (including creating lists).
- I'd like it if making lists was easier. e.g. grab list, display list of subcats with checkboxes, trawl those; remove dupes and incorrect namespaces, convert to talk, remove dupes; and get a category or transclusion list to filter against (semi) automatically
Version history
editSee: Wikipedia:AutoWikiBrowser/History
Version | Release date | Notes |
---|---|---|
2.1.0.1 | 13 September 2008 |
|
2.0.0.3 | 6 April 2008 | Changes per AWB and WF |
2.0.0.2 | User:Reedy Boy: WPNovels: 19th Century Task Force Added
Changes to Match AWB Changes | |
2.0.0.0 | 25 January 2008 | User:Kingboyk: Supports {{WikiProjectBannerShell}} and {{WikiProjectBanners}}. Thanks to User:Madman whose basic regex got me started.
Loosened up main template-catching regex to ignore stray vertical bars (e.g. living=yes||activepol=yes will no longer be flagged as a bad tag). All regexes cleaned. Various other minor tweaks. Bug fixes: Caught 2 causes of trivial edits (Yes/yes, different to Mediawiki but both supported by {{WPBiography}} for the important parameters; adding a workgroup e.g. arts when a higher level workgroup already exists e.g. filmbio but flagging this as a change). +the changes from the last 2 revisions which were only available in the AWB SourceForge repository. |
1.5.0.0 | n/a | User:Kingboyk: We now check incoming redirects for templates at runtime. This should help prevent the plugin becoming "stale" if Sam or I aren't around to update it, or if some keen but annoying person creates yet another redirect to, say, {{WPBiography}} without telling me :) Removed support for {{BioCOTWs}}, which has been deleted. Fixed a bug: template instances using "_" instead of space weren't being caught. Surprising this didn't bite anybody! WPBiography only (for now): replace boilerplate text left by User:SkiersBot, and {{stubclass}} templates with "Biography" in the parameters, with an auto=yes parameter. Plugin now recognises shell containers like {{WikiProjectBannerShell}} and it won't move WP templates around if they are present. However, for now we don't write new templates into those containers and the redirects to them are hard coded in. Really we need a class in this plugin, or a feature in AWB, to write WikiProjects into existing instances of these containers, add them where needed, rename them when a redirect name is used (with redirect names fetched dynamically), clean them up etc. |
1.4.0.4 | n/a | Reedy Boy: Code Tweaks. Change of WPAus to use class=cat rather than class=NA. Fix defaultsort moving bug on talk pages. |
1.4.0.3 | 9 September 2007 | Reedy Boy: Addition of a couple of parameters for WPNovels and WPAus |
1.4.0.1 | n/a | Kingboyk: Added "open skipped bad pages in browser" option. |
1.4.0.0 | 28 July 2007 | User:Reedy Boy & Kingboyk: Wikifunctions2.dll has been converted to C# and merged into AWB. Various modifications have been made to the plugin for it to work smoothly with AWB version 4. Note: Please help updating docs and links now wikifunctions2 no longer exists. |
1.3.0.0 | Kingboyk: Fixed bug in wiki-format logger where article name was truncated if it contained a colon. Improved edit summary and parameter handling when dealing with WPBiography child workgroups. Plugin logging now receives notification of username and logged in username changes, so errors with the log upload location being incorrect ought to be resolved. Now filter braces from a generic template definition. Major internal changes - now I have access to the AWB codebase too, I've been able to introduce a much more elegant OOP solution. However, the changes run quite deep so watch out for breakage please. | |
1.2.1 | 16 April 2007 | Kingboyk: Improved ETC timer to take account of skipped pages. Tidied up logging tab. |
1.2.0 | 14 April 2007 | Kingboyk: New features: Sam and I have improved the new AWB logging tab (we're both AWB devs now, so often fixes and improvements for the plugin will happen in AWB); this version of the plugin will now add log info to that tab. Added code to recognise and tidyup the DEFAULTSORT magic word or the {{DEFAULTSORT}} template; WPBio listas= parameter removed if DEFAULTSORT is present. Added an "estimated time of completion" label to the main Kingbotk plugin tab. Implemented feature requested by Mike Peel: "Build a list of pages that the plugin would change, without making any change. List should be in a format that can be read back into AWB to be processed."
Tweaks: Filter out illegal-in-page-names characters from upload-jobname (AWB-side routine written by Sam). Some code has been moved from plugin's wikifunctions2 to AWB's wikifunctions. Updated {{talkheader}} regular expression to catch redirects. Implemented Plugins\Kingbotk\Set AWB menu item: click this to turn off a few AWB features which the plugin doesn't need. WPBiography: Added explicit living=no parameter option. {{BioCOTWs}} is replaced with collaboration-candidate=yes. "Second chance" regex (the one which looks for bad or additional templates) tightened up a little. Added support for new Film workgroup. WPMILHIST: Migrate Middle-Ages-task-force to Medieval-task-force. Major regular expression change: The right-hand side of the templating regular expression, immediately after the end of the template name, now has a \b meaning "word boundary". My tests so far are positive but if advise me of any problems immediately please. Reedy Boy: WPMILHIST: Expanded template workgroups as per WPMILHIST. Expanded context menu to encompass workgroups. Added a simple error displaying form to catch log upload errors. |
1.1.0 | 30 March 2007 | Kingboyk: Various usability tweaks and internal changes. Added two new workgroup parameters for {{WPBiography}} (peerage and baronetcies). Updated WPBiography regular expression to handle {{Bio}} and {{BIO}} alternate names. Added WP Novels logs location. Fixed a bug in logging causing an extra (superfluous) log page to be created at the end of a run. Nudge timer removed in favour of same feature in new AWB. Tweak to have redlink category talk, template talk etc. increase the New page counter in tagging mode (previously only new Talk: pages upped the counter).
Reedy Boy: Expanded WPNovels Context Menu. |
1.0.1 | 24 March 2007 | Kingboyk: {{WPBiography}}: Replace parameterless {{activepolitician}} or {{activepol}} with activepol=yes. Skip article if only change is to add a WPBio listas= parameter. Add option to override the skip behaviour and force the addition of listas. Added code to ensure that the WPBio template is the last to be processed (including after generic templates) to hopefully ensure that living=yes gets top placement (after the templates mentioned in the next paragraph).
Add code to ensure that we leave {{skiptotoctalk}}/{{Skiptotoc}}/{{Skiptotoc-talk}} at the top. This new code, and the old {{talkheader}} code, has been placed into WikiFunctions2.dll so that other applications may use it too. Minor: Settings files with assessments and cleanup turned on were causing an error because of a change in AWB's user interface. Fixed. Reedy Boy: Minor: Fixed bug where settings couldn't be reloaded after generic template created with a space in the name. Space is automatically removed. |
1.0.0.1 RC5 | 17 March 2007 | Kingboyk: Minor: Logging: Improved handling of $USER and $CATEGORY keywords. |
1.0.0.1 RC4 | 10 March 2007 | Kingboyk: Improved support for WP Novels. Improved edit summaries. |
1.0.0.1 RC3 | 8 March 2007 |
|
1.0.0 RC2 | 4 March 2007 |
|
1.0.0 RC1 | 2 March 2007 | |
0.9.1 | 3rd December 2006 | Added support for {{WP India}}. Hopefully fixed the date formatting in log entries where user's Windows settings aren't English, by forcing the AWB thread to US English at startup. These edits done by me with Windows set to French were successful: [1] [2] |
0.9.0 | 11th November 2006 | Auto-uploading of logs. Skipped to v0.9, as current feature set is complete for v1 - just tweaking, small additions, and bugfixes to do. Logging feature significantly improved: logging tab with options and status, reusable logging feature in a new WikiFunctions2.dll, automatic uploading of logs, logging settings can be changed without having to restart AWB. Small issues with the first alpha release: This version waits until it has enough lines to do an upload, and does it. So, if you have it set to upload at 500 lines, and the eventual entire output is 501 lines, you'll get 2 pages upload, 500 lines and 1 line. I'll refine this in the next update. Bad page logs not uploaded. Don't change settings once logging has started yet; exit AWB and reload it. |
0.7.2 | Added XML settings file and textbox context menu for {{NovelsWikiProject}}. Added new "NBL" parameter for {{WP Australia}}. The WP Australia template has some parameters which can be called with alternate names ("V8", "v8"; "NBL", "nbl"), so I've written an extra (overloaded) "parameter check/add" routine, which can accept an alternate name, for those parameters to call. Plugin now uses the "AndAlso"/"OrElse" short circuiting expressions in places, for efficiency. This shouldn't break anything (hopefully!). Added 3 new boilerplate text buttons to the Comments form. Timer-reset button. Menu item to turn nudging on/off. | |
0.7.1r1 | (No code changes in plugin DLL). Supply the newest version of AWB (3.0.4.1). Updated settings file for {{Film}}. Supply settings file for {{WP Indonesia}}. | |
0.7.1 | i) Fixed a null-reference bug which was causing an error box to be displayed when clicking Skip on the assessments form. I'm not convinced this feature is robust though so please help me test it. ii) Plugin now checks the AWB edit summary box and if the summary is "clean up" (the AWB default) when tagging talk pages it changes it to "Tagging". This is a prelude to the "Set AWB" menu item for setting sensible AWB defaults, which I will implement soon. iii) Removed 2 unused menu items. iv) Added tooltips to menu items. | |
0.7.0 | Added {{songs}} and {{album}} plugins. Made preferred-name regex stricter ({{albums}} wasn't being renamed to {{album}}).. | |
0.6.2 | Added support for 3 new WPBiography workgroups and the {{musician}} template. Support one new WPMILHIST workgroup. Provided XML settings file for {{film}}. Some internal changes. Plugin should now merge multiple instances of same template on a page (regardless of name) if they have non-conflicting parameters and is otherwise a bit more lenient towards incorrectly formatted/doubly-added templates. Found a very strange case: page has one valid WPBio template and one bad WPBio template; the latter wasn't being noticed so the page wasn't being skipped as "bad tag". Fixed. | |
0.6.1 | Remove importance= parameters from existing instances of {{WPMILHIST}}, per request. Workaround for a bug which occurs when the Cleanup box is checked and the Manual Assessments box is not checked (cause is still a mystery). Plugin should no longer give AWB a nudge when the user has chosen to stop processing (not tested yet). Added entry for generic plugins and MILHIST to the edit box's context menu; also added submenu for "importance". Some minor internal architectural changes. Updated Physics XML (they now support auto=yes) and tested new settings. | |
0.6.0 | Added support for "Generic WikiProject templates". Added Auto-Stub feature for WPMILHIST. Minor architecture tweaks. Skip stub-class code if processing non main-talk, to get a more succinct edit summary and no stray auto=yes tag. | |
0.5.0 | Added {{WP Australia}} and {{WPMILHIST}} plugins. Changed placement of {{reqphoto}} in the assessments class. In bot (auto-save) mode, plugin gives AWB a kick if it doesn't send any articles in 10 minutes. (The newly supported templates don't have right-click context menus in the AWB edit box yet). | |
0.4.0 | Added Wikipedia assessments plugin. We now get notification from AWB of starting/starting so can log this and properly start/stop the timer. Red link checks/warnings. Non-standard namespace handling. | |
0.3.2 | Added code to customise template placement.
| |
0.3.1 | Edit-box context menu additions, UI improvements | |
0.3 | Much improved architecture, comprehensive user interface. {{WPBiography}} (all parameters) fully supported. Other templates being added. | |
0.2 | Development version. Added a user interface and placeholder support for other WikiProjects and for manual Wikipedia 1.0 assessments. | |
0.1 | Features Basic template addition/reparameterising for living persons bios. Object orientated design, with the BLP plugin inheriting from a base class. |
Done
edit- Menu items and user interface
- Multiple plugins per DLL.
- Turn plugin on/off
- Statistics tab
- Read/write XML settings
- Implement template positional placement code per User_talk:Kingboyk#Bot_tagging
- Leave the category talk pages in the list and tag with class=Cat
- Manual assessments: clean up article, inspect it in preview mode, and then open talk page for tagging and applying assessmentgive
- Bot mode: give AWB a kick if freezes up.
- Check that the article attached to the talk page hasn't been deleted (red link)
- Support for "generic WikiProject templates", allowing users to define their own template instance without it having to be specifically programmed in
- Added Milhist, Albums, Songs template plugins
- Added new Milhist, Bio and Australia workgroups
- Two new boilerplate text buttons on the Comments form, per User:Plange
- Timer-reset button
- Option to turn nudging on/off
- Context menu and XML settings for WP Novels
- Log uploads
- Logging features split out to a separate independent DLL (WikiFunctions2)
- Full support for {{WP India}}
- Bug fix: Date formatting in log entries where user's Windows settings aren't English
- Modified settings load/save code in line with AWB changes. Plugin can also convert old settings schema to new.
- Automated edit summaries in assessments mode
Mailing list/user list
editIf you download the plugin, please add the Plugin page to your watchlist. It's also recommended that you add your username here so that you can be notified of any critical updates. Note: I hope never to have to message you, as I will only send out mailing lists if a critical bug is discovered. For general news and notification of updates you need to add the page to your watchlist.
Technologies used
editThe plugin makes use of various technologies including: inheritance (see also polymorphism and encapsulation), interfaces, regular expressions, reflection, XML, XHTML, GDI+, and Windows Forms. Of course most modern programs use most or all of these but listing them like this makes me look clever ;)
Developers
editThe plugin was conceived and developed by Kingboyk (talk · contribs). It is now part of the main AWB repository and is maintained by the AWB developers. Source code is available.