Utente:Sirbot/Script: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Riga 96:
</source>
 
== monitoraggioimmaginimonitoraggiotest.py modificato ==
''Basato su [[Utente:BimBot/Scripts#monitoraggioimmagini.py]]''
<source lang="python">
#!/usr/bin/env python
Line 122 ⟶ 121:
always = True
site = wikipedia.getSite()
category_name = 'Categoria:Voci monitorate Progetto: Musica/Punk/Tabella monitoraggio automatico - immagini nc'
categoria = catlib.Category(site, category_name)
discussioni = categoria.articles()
Line 154 ⟶ 153:
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Non ci sono immagini: valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
if __name__ == "__main__":
try:
main talkText = page.get()
except wikipedia.Error, e:
finally:
print e # Print the error and skip
wikipedia.stopme()
continue
</source>
newTalkText = re.sub('\|\n? *?[Ii]mmagini= ?d\n', '|immagini= \n', talkText)
 
if talkText != newTalkText:
== monitoraggiofonti.py ==
wikipedia.showDiff(talkText, newTalkText)
<source lang="python">
if not always:
#!/usr/bin/env python
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
# -*- utf-8 -*-
else:
"""
choice = 'y'
README: Todo
if choice in ['A', 'a']:
"""
always = True
#
choice = 'y'
# (C) Pietrodn, 2007
if choice in ['Y', 'y']:
# (C) Sirabder87, 2008
try:
# (C) Filnik, 2008
page.put(newTalkText, u'[[WP:BOT|Bot]]: Trovate immagini: rimuovo valutazione "d"')
#
except wikipedia.Error, e:
# Distributed under the terms of the MIT license.
print e # Print the error and skip
#
continue
__version__ = '$Id: $'
match = re.search('(\<ref.*)', pageText, re.IGNORECASE)
#
import wikipedia, catlib, re
def main():
always = False
for arg in wikipedia.handleArgs():
if arg.startswith("-always"):
always = True
site = wikipedia.getSite()
category_name = 'Categoria:Progetto:Musica/Punk/Tabella monitoraggio automatico - fonti nc'
categoria = catlib.Category(site, category_name)
discussioni = categoria.articles()
for page in discussioni:
if not page.isTalkPage():
continue
associatedPage = page.toggleTalkPage()
try:
pageText = associatedPage.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\<</span>ref.*|\{\{references|\{\{cit)', pageText, re.IGNORECASE)
if match == None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
Line 223 ⟶ 200:
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Non ci sono fonti: valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Ff]onti= ?d\n', '|fonti= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Trovate fonti: rimuovo valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Vv]etrina)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= *?\n', '|accuratezza=a\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce in vetrina: completezza "a"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Ss]\|)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza=.*?\n', '|accuratezza=c\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Stub: completezza "c"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match == None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= ?c\n', '|accuratezza= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Non stub: rimuovo completezza "c"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Aa]\|)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= *?\n', '|accuratezza=d\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce da aiutare: completezza "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match == None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= ?d\n', '|accuratezza= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce non da aiutare: rimuovo completezza "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Dd]a correggere)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Ss]crittura= *?\n', '|scrittura=d\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce da correggere: scrittura "d"')
except wikipedia.Error, e:
print e # Print the error and skip