User:R. Hillgentleman/lonelyNotDisambig.py

出自維基百科,自由嘅百科全書
Jump to navigation Jump to search
#LONELYPAGES NOT DISAMBIG
#USES site.lonelypages(*) AND page.isDisambig(*)

import wikipedia

site=wikipedia.getSite()

list=site.lonelypages(100)

text=''
for i in list:
 if i.isDisambig(): continue
 t=i.title()
 text+='[['+t+']]\n'
 wikipedia.output(t)

page=wikipedia.Page(site,u'wikipedia:沙盒/lonelypages')
page.put(text,u'孤立頁')

wikipedia.output('....end')
wikipedia.stopme()

lonelyNotDisambig1.py[編輯]

#LONELYPAGES NOT DISAMBIG
#USES site.lonelypages(*) AND page.isDisambig(*)

import wikipedia

site=wikipedia.getSite()

list=site.lonelypages(100)

text=''
count=0
for i in list:

 if i.isDisambig(): 
   continue
 t=i.title()
 text+='[['+t+']]\n'
 wikipedia.output(t)
 count=count+1
 if count=500:
   page=wikipedia.Page(site,u'wikipedia:沙盒/lonelypages up to '+t)
   page.put(text,u'500 孤立頁 -'+t)
   wikipedia.output('500 lonely pages up to'+t+'recorded.\n Reset count and text\n')
   text=''
   count=0
   continue
wikipedia.output('....end')
wikipedia.stopme()