https://bugzilla.wikimedia.org/show_bug.cgi?id=59431

--- Comment #19 from Bugzilla Bug Importer (valhallasw) 
<wmf.bugconver...@gmail.com> ---
-------------------------------------------------------------------------------
From: drtrigon <dr.tri...@surfeu.ch>
Date: Fri, 26 Aug 2011 22:13:48
-------------------------------------------------------------------------------

New parameter 'simple' introduced in r158. An example of usage can be found at
[1] together with [2]. The syntax is as follows:

Instead of using e.g.

    {{Benutzer:DrTrigon/Entwurf/Vorlage:Subster
   
|url=http://toolserver.org/~drtrigon/cgi-bin/sum_cat_disc.py?wiki=de&cat=Freiburg%20im%20Breisgau&period=336
    |regex=<br>\n<table>(.*?)</table>\n<br>\nTime to process
    |postproc=('wikilinkedlist', '"_blank">(.*?)<')
    |value=valSumCatDiscTest
    }}


use now

    {{Benutzer:DrTrigon/Entwurf/Vorlage:Subster
   
|simple={{Benutzer:DrTrigon/Entwurf/Vorlage:Subster/Simple:sum_cat_disc|cat=Freiburg
im Breisgau|period=336}}
    |value=valSumCatDiscTest
    }}


in fact **all** parameters (including 'value') can be hidden or simplified this
way. The Template used look like this

    {{((}}Benutzer:DrTrigon/Entwurf/Vorlage:Subster/Simple:sum_cat_disc

   
|url=http://toolserver.org/~drtrigon/cgi-bin/sum_cat_disc.py?wiki=de&cat={{{cat}}}&period={{{period}}}
    |regex=<br>\n<table>(.*?)</table>\n<br>\nTime to process
    |postproc=('wikilinkedlist', '"_blank">(.*?)<')
    {{))}}


and is called `Benutzer:DrTrigon/Entwurf/Vorlage:Subster/Simple:sum_cat_disc`
[2]. This name can obviously also be chosen quite shorter and then used more
comfortable.

This is implemented by passing the text given in 'simple' to the
expandtemplates mediawiki api call. This should be as fast as reading a page
with options stored but could be improved by caching the used templates for
eventual re-use during (same) bot run.

[1]
http://de.wikipedia.org/w/index.php?title=Benutzer:DrTrigon/Spielwiese&diff=92924020&oldid=92915813
 
[2]
http://de.wikipedia.org/w/index.php?title=Benutzer:DrTrigon/Entwurf/Vorlage:Subster/Simple:sum_cat_disc&oldid=92923712

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to