Jump to content

User:Yapperbot/FRS/Documentation

From Wikipedia, the free encyclopedia

Documentation for Yapperbot

[edit]

Early Description

[edit]

source: https://en.wikipedia.org/wiki/Wikipedia:Bots/Requests_for_approval/Yapperbot

written by Naypta

Function details: The bot performs exactly the same work as that of Legobot in this area; that is to say, it checks for new RfCs and new Good Article nominations, and when it finds one, looks up relevant people on the WP:FRS page and sends a random sample (between 15 and 25) a notification, letting them know that it is there. For RfCs, it adds the RfC ID to a JSON file stored in the bot's userspace, which tells Yapperbot that it's already sent the RfC invites and doesn't need to again. It will remove the ID from the JSON once the RfC has been removed from the page. GA nominations are done through a different system, and do not require this - instead, as only one GA nomination can exist per page, they work by iterating through the nominees category, and saving the timestamp of the last completed nominee.
This is a complete rewrite of the bot in Golang, with no code even related to the current Legobot implementation. This has the main advantage that there is no database - all the needed information is stored on-wiki - so it would be a whole lot easier for someone else to pick up the bot in the event that I'm unable to continue to manage it and it breaks. I also suspect that, due to the compiled nature of Golang, it'd be a hell of a lot faster - although that's a suspicion, rather than any kind of actual metric.
The only cross-dependency on Legobot that it does have is for RfC IDs being given; however, there's no indication that Legobot is going to stop handing those out any time soon, so I think that should be alright for now. In the event that it does, this bot will stop working too, but all that means is that it just won't send out any RfC invites until either Legobot is fixed or this bot is patched to work without Legobot's intervention.
I've tested the bot on testwiki, and it appears to work correctly and as expected. The only change necessary to the way that the FRS currently works would be for the GA subscription headers to be updated for the new topics used by GA, which can be seen on the nominations page here. It is not necessary for the GA project to change anything or notify anyone so long as they are only changing subtopics; however, adding a new topic will not cause notifications to be sent until the FRS page is updated to match (because, obviously, there's nobody to send to). I would, however, also like to suggest that, as a one-off run, people with no contributions in a number of years are removed from the FRS list, as it seems there's a fair few of them.

Source Code

[edit]

Code is here: https://github.com/mashedkeyboard/yapperbot-frs

Tools are here: https://github.com/mashedkeyboard/ybtools --David Tornheim (talk) 18:10, 3 July 2020 (UTC)

Files

[edit]
Top Level Files
[edit]

Located at: https://github.com/mashedkeyboard/yapperbot-frs

Top level files of Yapperbot
File Nml link Notes
src https://github.com/mashedkeyboard/yapperbot-frs/tree/master/src directory of more files -- probably where the main code is stored
.gitignore https://github.com/mashedkeyboard/yapperbot-frs/tree/master/.gitignore based on name "ignore" this file might not do anything

src .gitignore LICENSE README.md config-frs.enwiki.yml config-frs.sample.yml config-frs.testwiki.yml feedback.go frsRequesting.go go.mod go.sum main.go matchers.go runfile.go

<a href="https://github.com/mashedkeyboard/yapperbot-frs/tree/master/src" title=src>src</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/.gitignore" title=.gitignore>.gitignore</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/LICENSE" title=LICENSE>LICENSE</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/README.md" title=README.md>README.md</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/config-frs.enwiki.yml" title=config-frs.enwiki.yml>config-frs.enwiki.yml</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/config-frs.sample.yml" title=config-frs.sample.yml>config-frs.sample.yml</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/config-frs.testwiki.yml" title=config-frs.testwiki.yml>config-frs.testwiki.yml</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/feedback.go" title=feedback.go>feedback.go</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/frsRequesting.go" title=frsRequesting.go>frsRequesting.go</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/go.mod" title=go.mod>go.mod</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/go.sum" title=go.sum>go.sum</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/main.go" title=main.go>main.go</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/matchers.go" title=matchers.go>matchers.go</a>

<a href="https://github.com/mashedkeyboard/yapperbot-frs/blob/master/runfile.go" title=runfile.go>runfile.go</a>

./src
[edit]
Files in ./src
File Name Link Notes
frslist (folder) frslist (folder)
ga (folder) ga (folder)
rfc (folder) rfc (folder)
yapperconfig (folder) yapperconfig (folder)
./src/frslist
[edit]
Files in ./frslist
File Name Link Notes
frslist.go frslist.go
frsuser.go frsuser.go
sentcountserializer.go sentcountserializer.go

Subroutines

[edit]
Subroutines
Subroutine Name in File in Folder Purpose input output
GetUsersFromHeaders() frslist.go ./src/frslist Takes a list of headers and an integer number of users n, and returns a randomly selected portion of the users from the headers, with a total size of maximum n.

It won't pick the same user twice, and weights the users based on how far through their limit they are, in an attempt to spread things out a bit. It may pick less than n if there are less users available.

headers []string,
allHeader string,
n int
returnedUsers []*FRSUser
Tools
[edit]

Located at: https://github.com/mashedkeyboard/ybtools

  • LICENSE
  • README.md
  • config-global.enwiki.yml
  • config-global.sample.yml
  • config-global.testwiki.yml
  • config.go
  • content.go
  • editlimit.go
  • error.go
  • go.mod
  • go.sum
  • nobots.go
  • setup.go
  • taskkill.go
  • wikijson.go
  • wikinteract.go

Data Structures

[edit]

from: https://github.com/mashedkeyboard/yapperbot-frs/blob/master/src/ga/ga.go

// Nom represents a GA nomination, which has a single category only.

type Nom struct {
Topic string
Article string
Subtopic string
}