# A pywikibot script to dump out all DYK nominations in a listimportreimportpywikibotfrompywikibotimportpagegeneratorsimportsysusername=sys.argv[1]reDYK=re.compile('^Giving DYK credit for \[\[([^\]]+)\]\]')site=pywikibot.Site()tp=pywikibot.Page(site,'User talk:'+username)forrevintp.revisions(reverse=True):ifrev.user=='DYKUpdateBot':match=reDYK.match(rev.comment)ifmatchisnotNone:page=match.group(1)print('# '+rev.timestamp.strftime('%d %B %Y')+' [['+page+']]')