利用者:Bcxfubot/BOT作業依頼/log/20210125/prog2
表示
import pywikibot
pagelist = [
]
def create_pagelist():
global pagelist
path = "a"
with open(path) as f:
pagelist = [s.strip() for s in f.readlines()]
print(pagelist)
def is_linked_from_wikiindex( site,pagename):
page = pywikibot.Page(site, pagename)
ret = page.getReferences()
for item in ret:
linked_page_name = item.title()
if "索引" in linked_page_name:
#print("索引あり")
return True
return False
def proc_page(site,pagename):
#print(pagename)
if ( not is_linked_from_wikiindex( site,pagename) ):
print(pagename)
def main(*args):
site = pywikibot.Site()
create_pagelist()
for pagename in pagelist:
proc_page(site,pagename)
if __name__ == '__main__':
main()