I'm working on a server-side script that will periodically revise wiki
pages that all use the same template. Is there a function I can use that
will parse a page and then find and replace template arguments with values
I determine within my script?

For example, let's say I have Template:Beer like the following:

{{Beer
|Name=
|Brewery=
|Style=
|ABV=
|IBU=
}}

So if I had a page Rocket Fuel:

{{Beer
|Name=Rocket Fuel
|Brewery=8th Wonder
|Style=Vietnamese Coffee Porter
|ABV=4.6
|IBU=18
}}

Let's say my script "discovered" an error in one of the arguments and
needed to update the page. For example, let's say the IBU was actually 28.
Is there a function that will find and replace the value for IBU in the
page?

I'm currently using regex, but I'm wondering if there's a more trustworthy
method.

Thanks,

Daren
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to