Jump to content

Topic on Manual talk:Pywikibot

ColumbaBush (talkcontribs)

Hi @Xqt - thanks for all the work you've done on pywikibot, I've used template.py for simple replacements via https://en.wiktionary.org/wiki/User:ColumbaBushBot but now I wanted to do something more complicated

  1. detect if {{aii-verb}} exists
  2. extract its first argument
  3. and replace the aii-conj-verb template (ex. {{aii-conj-verb/G]}}, {{aii-conj-verb/C]}}, etc...) with {{aii-conj|<first argument from step 2>}}

An example of this would be this edit https://en.wiktionary.org/w/index.php?title=%DC%A5%DC%A2%DC%90&diff=prev&oldid=82304028

Can you recommend how I can use existing scripts to accomplish this, or perhaps even provide a code snippet to modify an existing script?

Thanks so much, your help is greatly appreciated

Reply to "Replacing templates"