Jump to content

User:David Tornheim/YapperBotRelated

From Wikipedia, the free encyclopedia

recent discussion

[edit]

Yapperbot pages on Wiki

[edit]

github

[edit]

Post to Phabricator (to be revised)

[edit]
    • While you all are deciding what to do with the adoption process, could you please unprotect the code files in yapperbot?**

In order to maintain the code--either at its original location or at the new location of feedback-request-service-bot--I need to be able to see the most current version of the code. I have tried running the version from github (on my home computer and here on Toolforge), and I keep getting errors. Novem_Linguae and I both agree that it is better not to continue to waste time working with a version which may not be correct. There is no way to be sure that the version on Toolforge is identical to the one published on github.

As for the errors: I have requested assistance on the errors at a few different forums (below). It is related to Go's sophisticated method of maintaining modules--which is new to me. (See: https://go.dev/ref/mod). Other Go users have had similar problems (https://github.com/google/gnostic/issues/262). I have tried their suggestions without much luck so far. It would be easier to just download all of the code that is currently being used on Toolforge and then correct the definitions (in the copied version) that are causing the compile problems.

These are the locations where I requested assistance:

https://discordapp.com/channels/221049808784326656/1225262073814974494


All forums

[edit]

[3]

Teahouse question

[edit]

closed discussion [4]

Questions

[edit]

Pick a framework

[edit]

[copied from User:Novem_Linguae/Essays/Toolforge_bot_tutorial#Pick_a_framework]

  • Whatever language you're writing your bot in, you'll probably want to pick a framework (external library) specifically designed for logging into Wikipedia and using its API.
  • For PHP, I use the ancient framework botclasses.php. It's not modern, but it fits nicely in one file.
  • One file means I can simply copy/paste the code into my repo, then do <?php include('botclasses.php');, and now I can log in to Wikipedia and execute API commands with a lot less code. Example botclasses.php code:
<?php

include('botclasses.php');

// Log in
$wp = new wikipedia();
$wp->http->useragent = '[[en:User:Feedback Request Service bot]] task A, owner [[en:User:Feedback Request Service bot]], framework [[en:User:RMCD_bot/botclasses.php]]';
$wp->login('usernameGoesHere', 'passwordGoesHere');

// Get page wikicode
$pageTitleIncludingNamespace = 'User:Feedback Request Service bot/userlist.js';
$oldWikicode = $wp->getpage($pageTitleIncludingNamespace);

// Edit page wikicode
$pageTitleIncludingNamespace = 'User:Feedback Request Service bot/userlist.js';
$newWikicode = '//Test!'
$editSummary = 'Update list of users who have permissions (Feedback Request Service bot Task A)';
$wp->edit(
	$pageTitleIncludingNamespace,
	$newWikicode,
	$editSummary
);

Consider

[edit]

Here's some stuff that is installed and can be accessed in shell

Working on right now

[edit]

SSH on Toolforge

  1. Question just filed at User_talk:GreenC#User:GreenC/BotWikiAwk. Anyone who is watching please feel free to answer there. --David Tornheim (talk) 11:32, 16 March 2024 (UTC)
  2. was able to follow User:Novem_Linguae/Essays/Toolforge_bot_tutorial through
makebot ~/botname.
I see that the bots are stored at /data/project
3. I looked at the Yapperbot folder. Some of the files were unprotected, e.g. jobs.yml, DISABLED (explains the migration), pruner/config-pruner.yml. It looks like some of the files are binary/executables, e.g. pruner/pruner. That explains what he meant by "compiled".
4. Next up: try either or both of the tutorial do a script or bot type call with Wiki API, or even try to run a line or two from Yapperbot using go. --David Tornheim (talk) 12:15, 16 March 2024 (UTC)

New Next

[edit]

Old Next/Discussions

[edit]

Relevant Pages

[edit]

Questions

[edit]

For extra technical help in the future, onwiki you can post at WP:VPT. Or if you prefer live chat, you can post on Discord in General Technical Discussion. –NL, 02:24, 19 February 2024 (UTC) [source: User_talk:Novem_Linguae#Yapperbot, [5]

Login

[edit]

Phabricator

[edit]

Start

[edit]

Copy entire conversation before reducing down.

@Novem Linguae: You had asked me to create a Toolforge account. I went to the link you provided. Is this the correct place to apply? They mention "member", "maintainer", "admin" and "developer".

I think you'll probably want to create an LDAP account, then request Toolforge membership. –NL 01:34, 21 February 2024 (UTC)
After that, let's do the abandoned tool procedure by filing this ticket on Phab. I'd suggest that you file it and put both our usernames so we both get access. –Novem Linguae (talk) 01:48, 21 February 2024 (UTC)
@Novem Linguae: As you can see in the next section below, that Yapperbot is running again. It started with this activity at 6:00, 21 February 2024. Is that your doing? --David Tornheim (talk) 08:30, 21 February 2024 (UTC)
 Done LDAP account created. --David Tornheim (talk) 17:20, 21 February 2024 (UTC)
 Done Toolforge membership request submitted. --David Tornheim (talk) 23:23, 21 February 2024 (UTC)

Other relevant discussion

[edit]

From: User_talk:Yapperbot

You definitely seem to have more than enough background :) I've never run a Wikipedia bot, but here's my interpretation:
  1. The bot's entry point seems to be main.go. Bot calls aren't from Wikipedia; the bot operator runs the bot's code on their machine to monitor changes on Wikipedia.
  2. See Help:Creating a bot § Testing. Basically do a dry run of your bot.
Aaron Liu (talk) 22:26, 18 February 2024 (UTC)
It was actually run from Toolforge, presumably via a crontab that ran "jsub main.go", although I don't have access to Toolforge so can't be 100% sure. * Pppery * it has begun... 22:53, 18 February 2024 (UTC)
Since the bot inactivity coincided with the grid engine shutdown, that does seem likely. Aaron Liu (talk) 02:16, 19 February 2024 (UTC)
Pinging @Enterprisey: who might have advice. 𝗐♥, – SJ + 01:43, 19 February 2024 (UTC)
If I were you, I would apply for a ToolForge account. ToolForge is where Wikipedia bots are often hosted and set up to automatically run.
Once approved, use an FTP client to take a peek at the Yapperbot files. Toolforge files are usually public to other Toolforge users, unless set to Linux chmod 0600 or similar. The Yapperbot files are probably located at the path "/data/project/yapperbot" or similar. These may be more up-to-date than what is in GitHub repos, and may also include some configuration files that tell you how the cronjob worked (time interval, bash code to start the bot, etc.)
To set up your own bot or your fork of Yapperbot to use Toolforge cron jobs, you'll want to SSH in to your Toolforge account and then set up a "job". This is the new way to do Toolforge cron jobs. The help file is at wikitech:Help:Toolforge/Jobs framework. One of the old ways to do Toolforge cron jobs is the "grid engine", and this also happens to be why Yapperbot was shut down. The Toolforge sysadmins want to force upgrading to the jobs framework, so they are shutting down all bots still running on the grid engine, including Yapperbot.
How can a bot be tested without changing Wikipedia pages? Use https://test.wikipedia.org/ as a big sandbox, if needed. Those edits will go live on test.wikipedia.org, but won't hurt anything. Or see if the bot has a "dry run" option of some sort by reading its program code. –Novem Linguae (talk) 02:41, 19 February 2024 (UTC)