User:YiFeiBot/wikiindex size.py: Difference between revisions

Update
(Update)
(Update)
Line 61: Line 61:
         newtext = text
         newtext = text
          
          
         size_r = re.compile(ur"""(?im)(?P<all>\{\{\s*Size\s*((\s*\|\s*(?P<pages>pages|wiki[ _]pages)\s*=\s*(?P<pages_value>\d*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<pagesurl>statistics[ _]URL|wiki[ _]statistics[ _]URL)\s*=\s*(?P<pagesurl_value>https?://[^ \|\}\<]*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<wikifactor>wikiFactor)\s*=\s*(?P<wikifactor_value>\d*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<wikifactorurl>wikiFactor[ _]URL)\s*=\s*(?P<wikifactorurl_value>http://[^ \|\}\<]*)\s*[^\|\}]*\s*))+\s*\|?\s*\}\}(\(As[ _]of[ _](?P<day>\d*)[ _](?P<month>)[ _](?P<year>\d*)\)+\s*\|?\s*))""")
         size_r = re.compile(ur"""(?im)(?P<all>\{\{\s*Size\s*((\s*\|\s*(?P<pages>pages|wiki[ _]pages)\s*=\s*(?P<pages_value>\d*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<pagesurl>statistics[ _]URL|wiki[ _]statistics[ _]URL)\s*=\s*(?P<pagesurl_value>https?://[^ \|\}\<]*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<wikifactor>wikiFactor)\s*=\s*(?P<wikifactor_value>\d*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<wikifactorurl>wikiFactor[ _]URL)\s*=\s*(?P<wikifactorurl_value>http://[^ \|\}\<]*)\s*[^\|\}]*\s*))+\s*\|?\s*\}\}(\(As of (?P<day>[1-31]) (?P<month>(?=January|February|March|April|May|June|July|August|September|October|November|December)) (?P<year>[0-9][0-9][0-9][0-9])\)+\s*\|?\s*))""")


         wtext = page.get()
         wtext = page.get()
Line 83: Line 83:
             month = i.group('month') and i.group('month').strip() or ''
             month = i.group('month') and i.group('month').strip() or ''
             year = i.group('year') and i.group('year').strip() or ''
             year = i.group('year') and i.group('year').strip() or ''
         
           
             #get new values
             #get new values
             n = re.findall(ur"(https?://[^\|\}\]]+\?action=raw|https?://[^\|\}\]]+:Statistics)", pagesurl_value)
             n = re.findall(ur"(https?://[^\|\}\]]+\?action=raw|https?://[^\|\}\]]+:Statistics)", pagesurl_value)
Line 364: Line 364:
     finally:
     finally:
         pywikibot.stopme()
         pywikibot.stopme()
</pre>
</code>
checkuser, Administrators
2,635

edits