1. -*- coding: utf-8 -*-

really = True

import sys, os import time, datetime import codecs import socket import re

  1. import wikipedia, config

import pywikibot as wikipedia

site=None


def report(text =""):

 wikipedia.output(text)


def main():

  1. wikipedia.output(u"utf-8")
  2. wikipedia.output(u"Starting: " + str(datetime.datetime.now()))
 site = wikipedia.Site('tt', 'wikipedia')  # The site we want to run our bot on
 
 #page = wikipedia.Page(site, 'Wikipedia:Sandbox')
 #text = page.get()  # The current text on the page
 #text = text.replace('foo', 'bar')
 #page.put(text, 'Replacing "foo" with "bar"')  # Saves the page
 #site=wikipedia.getSite()
  1. if site.loggedin():
  2. report(u"Logged in (%s)" % repr(site))
  3. else:
  4. report(u"Not logged in (%s)" % repr(site))
  5. os.exit(2)
 global tempfile
 tempfile = None
 global page
 page = None
    1. Параметраш абатца ягаръяр.
 for a, b, c, d, e, f, g in zip(parametera, parameterb, parameterc, parameterd, parametere, parameterf, parameterg):
   page = wikipedia.Page(site, title = (u""+ a))
   if page.exists:
     if not page.isEmpty:
       temptext = page.get()
       regexp = u"^.xx$"
       if re.compile(regexp, re.M).search(temptext):
         wikipedia.output(u"агӀо йолуш ю: йита...")
       else:
         wikipedia.output(u"агӀо йолуш ю: йита...")
         continue
     else:
       wikipedia.output(u"агӀо кхуллу...")
   else:
     wikipedia.output(u"агӀо йолуш ю: йита...")
   text =u"
Викихаамашкахь элемент йац

\n"+ \

u""+ a + u" — Мелхан системан коьрта асанан астероид.\n" + \ u"\n"+ \ u"== Истори ==\n" + \ u"\n"+ \ u"ДӀайиллина "+ c + u" "+ d + u" цӀе йолу Ӏилманчо обсерваторехь "+ e + u". Юьхьанца дуьйна йолу цӀе - «"+ f + u"» саналган.\n"+ \ u"\n"+ \ u"== Хьосташ ==\n"+ \ u"\n"+ \ u"* Lutz D. Schmadel. Dictionary of Minor Planet Names. — Fifth Revised and Enlarged Edition. — B., Heidelberg, N. Y.: Springer, 2003. — 992 p. — ISBN 3-540-00238-3.\n"+ \ u"* Lutz D. Schmadel. Dictionary of Minor Planet Names. — Springer Science & Business Media, 2012-06-10. — 1458 с. — ISBN 9783642297182\n"+ \ u"* Chapman, C. R., Morrison, D., & Zellner, B. Surface properties of asteroids: A synthesis of polarimetry, radiometry, and spectrophotometry// Icarus : journal. — Elsevier, 1975. — Vol. 25. — P. 104—130.\n"+ \ u"* Kerrod, Robin. Asteroids, Comets, and Meteors (неопр.). — Lerner Publications Co., 2000. — ISBN 0585317631.\n"+ \ u"\n"+ \ u"== Билгалдахарш ==\n"+ \

u"

\n"+ \

u"\n"+ \ u"== Хьажа иштта ==\n"+ \ u"\n"+ \ u"* "+ g + u"\n"+ \ u"Кеп:Мелхан система\n"+ \ u"\n"+ \ u"\n"+ \ u"Категори:Коьрта асанан астероидаш\n"+ \ u"Категори:Астероидаш абатца\n"+ \ u"\n"+ \ u"uk:"+ a + u"\n"+ \ u"en:"+ b + u"\n"+ \ u"tt:"+ a + u"\n"+ \ u"pt:"+ b + u"\n"

   if really:
     try:
       #status, reason, data = page.put(text, comment = u"Бот:Астероидаш")
       page.put(text, comment = u"Бот:Астероидаш")
     except wikipedia.EditConflict as error:
       wikipedia.output(u'ГӀалат: %s. Сацийна.' % error)
     except (socket.error, IOError, wikipedia.PageNotSaved) as error:
       wikipedia.output(u'ГӀалат: %s. Сацийна.' % error)
     else:
       #print status, reason
       continue


  1. end of main
  1. running:

if __name__ == "__main__":

 try:
   main()
 except:
   wikipedia.stopme()
   raise
 else:
   wikipedia.stopme()
 wikipedia.stopme()
Damir/Астероид11 декъашхочун агӀоне йухагӀо.