Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.
UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.
Python:NC oderer.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Bot to report only the images with the same license in a page to delete them easlier. """ # # (C) Filnik, 2008 # # Distributed under the terms of the MIT license. # __version__ = '$Id: $' # import wikipedia, re from nowcommons import word_to_skip from imagetransfer import licenseTemplates # take the license combinations def main(): arg = wikipedia.handleArgs() site = wikipedia.getSite() page = wikipedia.Page(site, 'Utente:Filnik/Nowcommons') source_text = page.get() list_of_words_to_skip = wikipedia.translate(site, word_to_skip) #*[[:Image:Cercola-Stemma.png]] - [[:Commons:Image:Cercola-Stemma.png]] array = re.findall(r'\*\[\[:Image:(.*?)\]\]\s*?-\s*?\[\[:Commons:Image:(.*?)\]\]', source_text) same_name_array = list() for element in array: wiki_image = element[0].replace('_', ' ') commons_image = element[1].replace('_', ' ') skip = False for word in list_of_words_to_skip: if word.lower() in wiki_image.lower(): skip = True if skip: continue if wiki_image == commons_image: wikipedia.output(u'%s = %s' % (wiki_image, commons_image)) same_name_array.append([wiki_image, commons_image]) output_page = wikipedia.Page(site, 'Utente:Filnik/Nowcommons/Same_Name') string = '' for element in same_name_array: string += '*[[:Image:%s]] - [[:Commons:Image:%s]]\n' % (element[0], element[1]) output_page.put(string, 'Bot: Reporting the log') if __name__ == "__main__": try: main() finally: wikipedia.stopme()