Commons:Bots/Requests/EatchaBot

EatchaBot (talk · contribs)

Operator: Eatcha (talk · contributions · Statistics · Recent activity · block log · User rights log · uploads · Global account information)

Bot's tasks for which permission is being sought: Adding MOTD/POTD template to MOTD/POTD file page. With correct parameters.

Automatic or manually assisted: Designed to run automatically or manually. But will run without supervision and automatically.

Edit type (e.g. Continuous, daily, one time run): Daily, one time run. Tags 12 hour before the file is on the main page. also notify the uploader as soon as the file's on the main page.

Maximum edit rate (e.g. edits per minute): ~ 4 edit per day

Bot flag requested: (Y/N): Yes

Programming language(s): Python3

Eatcha (talk) 12:34, 15 November 2019 (UTC)[reply]

Discussion

No one except User:Jdx seems interested in tagging MOTDs, this should help in reducing administration job as the file can't be tagged by non admins, thanks to cascading protection. Cron is scheduled, if you provide permission I can do 50 edits in advancement or we can wait for 50 days. 1 edit is already made by the bot. Thanks --Eatcha (talk) 12:34, 15 November 2019 (UTC)[reply]

Please make new test run, because you changed same files several times. Does bot check existence of template? Could bot also put template near similar templates without empty line? --EugeneZelenko (talk) 15:37, 15 November 2019 (UTC)[reply]
EugeneZelenko Yes it checks for existing templates and I removed "/n" from the source. And also made some edits. Thanks -- Eatcha (talk) 15:52, 15 November 2019 (UTC)[reply]
Should I do the same for potd ? The potd participants can do it manually as they are more in numbers, but maybe it should be automated. -- Eatcha (talk) 15:57, 15 November 2019 (UTC)[reply]
It should be automated because sometimes nominators forget to tag nominated file with {{Picture of the day}}, although not so often as it is in case of MOTDs. Also it would be nice if the bot could add =={{Assessment}}== header and group underneath templates such as {{Assessments}} (with s!), {{QualityImage}}, {{VI}} {{FV promoted}} and of course {{Picture of the day}}/{{Media of the day}}. --jdx Re: 18:09, 15 November 2019 (UTC)[reply]
I scheduled the job for potd, 12 hours before they are on the main page similar to motd. Made some edits both POTDs and MOTDs.
The problem of QICBot and VICBot shoudld be fixed by using the following alogrithm. It's better than creating a new subheading IMHO. It can find end of any template:
    def findEndOfTemplate(self, text, template):
        m = re.search(r"{{\s*%s" % template, text)
        if not m:
            return 0

        lvl = 0
        cp = m.start() + 2

        while cp < len(text):
            ns = text.find("{{", cp)
            ne = text.find("}}", cp)

            # If we see no end tag, we give up
            if ne == -1:
                return 0

            # Handle case when there are no more start tags
            if ns == -1:
                if not lvl:
                    return ne + 2
                else:
                    lvl -= 1
                    cp = ne + 2

            elif not lvl and ne < ns:
                return ne + 2
            elif ne < ns:
                lvl -= 1
                cp = ne + 2
            else:
                lvl += 1
                cp = ns + 2
        # Apparently we never found it
        return 0

Usage: The following should find end of Information template, which is present on all files.

end = findEndOfTemplate(old_text, "[Ii]nformation")

-- Eatcha (talk) 14:56, 16 November 2019 (UTC)[reply]

There are some past motds(not sure about potds, but possible) left without tags, should I also run a task to mark those by checking from the date when potd and motd was started? -- Eatcha (talk) 15:15, 16 November 2019 (UTC)[reply]

It's definitely good material for test run. --EugeneZelenko (talk) 15:28, 16 November 2019 (UTC)[reply]
I found some issues, but they are now patched IMO. -- Eatcha (talk) 03:52, 19 November 2019 (UTC)[reply]
Could you please notify when new test run is ready? In older edits bot didn't detect existing template. I also see problem with date parameters (leading zeros). Template position is also subject for discussion. Some similar templates are placed after license template(s). --EugeneZelenko (talk) 15:12, 19 November 2019 (UTC)[reply]
EugeneZelenko what do you mean by date parameters (leading zeros) ? I am aware of other problems and have fixed most, but I don't get what's wrong with date parameters. Best, -- Eatcha (talk) 15:54, 19 November 2019 (UTC)[reply]
See this edit. --EugeneZelenko (talk) 15:58, 19 November 2019 (UTC)[reply]
IMHO fixed see Special:Diff/376531416 Special:Diff/376534440 -- Eatcha (talk) 02:49, 20 November 2019 (UTC)[reply]
  Done EugeneZelenko New test run's ready, tagged all current MOTDs for 2020. Best, Eatcha (talk) 05:07, 20 November 2019 (UTC)[reply]
EugeneZelenko Where should I add the template ? I will do whatever you say, AS you are the judge(or 'crat). I am getting confused by differing views on the postion of template. Most users seem to prefer the position above the license as per analysis of POTDs at Commons:Picture_of_the_day. I need to finalize the code ASAP, beacuse I have other IRL stuff than changing the code for non-issues(Postion doesn't even matters as my goal with this bot is to "tag files which were left without the appropriate tag, If someone wants to place the tag at the top of page it's their choice."). I can also leave files uploaded by specific users, if they wish. Thanks, Eatcha (talk) 15:11, 20 November 2019 (UTC)[reply]
Just look on usage of other quality assurance and something of the day templates.
Please also teach bot consistency about empty line between added template and categories (example).
EugeneZelenko (talk) 15:15, 20 November 2019 (UTC)[reply]
EugeneZelenko   Done see. Could you please clarify what do you mean by "Just look on usage of other quality assurance and something of the day templates." Thanks Eatcha (talk) 15:30, 20 November 2019 (UTC)[reply]
Yes, especially in cases when such templates are also added by bots. --EugeneZelenko (talk) 15:35, 20 November 2019 (UTC)[reply]
Also, notifying users to encouage more participation. see 1 and 2 -- Eatcha (talk) 14:25, 25 November 2019 (UTC)[reply]
Please do not count https://commons.wikimedia.org/w/index.php?title=Commons:Quality_images_candidates/candidate_list&diff=prev&oldid=378097937 as a test, it was a misclick while realeasing a patch to qicbot. I hope you understand, Thanks -- Eatcha (talk) 09:01, 27 November 2019 (UTC)[reply]
Looks OK for me. --EugeneZelenko (talk) 15:52, 27 November 2019 (UTC)[reply]

If there are no objections, I think bot status should be granted. --EugeneZelenko (talk) 16:08, 4 December 2019 (UTC)[reply]