diff --git a/bots/missingnotice.py b/bots/missingnotice.py index 77aaa35..3d19787 100644 --- a/bots/missingnotice.py +++ b/bots/missingnotice.py @@ -29,6 +29,8 @@ import pywikibot import jogobot +from lib.redfam import RedFamWorker + class MissingNoticeBot(pywikibot.bot.Bot): """ @@ -47,10 +49,24 @@ ON `cl_from` = `page_id` def __init__( self, genFactory, **kwargs ): + self.categorized_articles = list() + self.page_content = list() + super(type(self), self).__init__(**kwargs) def run( self ): - pass + # query articles containing notice + self.categorized_articles = type(self).get_categorized_articles() + + # iterate open redfams + for redfam in RedFamWorker.gen_open(): + links = self.treat_open_redfam(redfam) + + if links: + self.page_content.append( self.format_row( links ) ) + + # Update page content + self.update_page() def treat_open_redfam( self, redfam ): """