Hi GoEThe,

I’ve seen you are importing the the NoReferencesBot but you does not use it. addReferences() is not a function but a class method. You have either to localise the framework script (or open a Phabricator task for it) or you have to subclass the bot if the behaviour is very different from the generic script. Override the affected methods if necessary. 

Refer the doc: https://doc.wikimedia.org/pywikibot/master/scripts/scripts.html?highlight=addreferences#scripts.noreferences.NoReferencesBot.addReferences

For further questions do not hesitate to ask.


Am 29.11.2021 um 17:24 schrieb goethe.wiki@gmail.com:


I am trying to build a script to add a reference to a few hundred articles on pt.wikipedia. I would like to use the noreferences.py script that is part of core, to add a reference section in the same run, if it is not already present in the article.
I have tried to import the script, the NoReferencesBot class, but I must be doing something wrong. It says that the function hasn't been defined.

You can check what I have been trying to do here: https://public.paws.wmcloud.org/User:GoEThe/IUCN%20status.ipynb

Any help will be greatly appreciated!

pywikibot mailing list -- pywikibot@lists.wikimedia.org
To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org