Only you can help us build a free scout media repository!
Please create an account to start uploading your images now.

ScoutMedia:Bot configuration/yeargene.py: Difference between revisions

From ScoutMedia, the free scout media repository
No edit summary
 
Line 1: Line 1:
If you copy the code from the source, make sure you remove all the <nowiki><nowiki></nowiki> tags before using !
If you copy the code from the source, make sure you remove all the <nowiki><nowiki></nowiki> tags before using !


''Texts are in French, for help ask [[User:Akela NDE|Akela]] -<small><small>[[Discussion Utilisateur:Akela NDE|Haooww !]]</small></small> - Or just look by yourself how those pages work on PartioWiki and Scoutopedia.''
''Texts are in French, for help ask [[User:Akela NDE|Akela]] -<small><small>[[User talk:Akela NDE|Haooww !]]</small></small> - Or just look by yourself how those pages work on PartioWiki and Scoutopedia.''


  #!/usr/bin/python
  #!/usr/bin/python

Latest revision as of 14:57, 1 July 2009

If you copy the code from the source, make sure you remove all the <nowiki> tags before using !

Texts are in French, for help ask Akela -Haooww ! - Or just look by yourself how those pages work on PartioWiki and Scoutopedia.

#!/usr/bin/python
# -*- coding: utf-8  -*-

__version__='$Id: dategene.py,v 1.0 2006/04/4 19:26:01 wikipedian Exp $'

import wikipedia
import login

msg = {
         'en':u'Robot: Year page created',
         'fr':u"Bot: cr\u00e9ation de la page d'ann\u00e9e."
       }

comment = wikipedia.translate(wikipedia.getSite(), msg)
wikipedia.setAction(comment)

s=wikipedia.getSite()
for pa in range(1907,2020):
      pp=pa
      p=wikipedia.Page(s,str(pp))
      st=u"<!--Lister les \u00e9v\u00e8nements par ordre chronologique, en pr\u00e9cisant la date. Pour les \u00e9v\u00e8nements dont la date n'est pas connue, les lister en dessous.-->"
      st+=u'\n'
      st+=u'{{navigation dates|hier='+str(pp-1)+'|demain='+str(pp+1)+'}}\n'
      st+=u'\n'
      st+=u'{{portail histoire}}'
      st+=u'\n'
      st+=u'[[Cat\u00e9gorie:Chronologie du scoutisme]]\n'
      st+=u'[[nl:'+str(pp)+']]\n'
      st+=u'[[fi:'+str(pp)+']]\n'
      st+=u'\n'
      p.put(st)
wikipedia.stopme()