Template talk:User weapon checklist

From Team Fortress Wiki
Revision as of 05:05, 2 July 2010 by RJackson (talk | contribs)
Jump to: navigation, search

New Steam Web API's

With the new steam web API's, would it be possible to have these checklists automagically update themselves by a user just inputting their steam ID. For example, {{Template:User_weapon_checklist|userid=rjackson}} I'm reading into the new API's now and seeing what I can come up with. If anything worthy of your attention I'll comment here. --RJackson 02:16, 2 July 2010 (UTC)

Not without a MediaWiki extension that can interpret XML, JSON or VDF. This has been something we've looked at in the past, it may just be possible to do so now. I will see if I can get make some progress. -- Pilk (talk) 02:31, 2 July 2010 (UTC)
Out of boredum I'm attempting to create a PHP script (i believe mediawiki extensions can be done in PHP) that parses an XML from the Web API and turn it into the Wiki code for this template. By wiki code, I mean output like this: {{Template:User_weapon_checklist | pain train=yes | homewrecker=yes | dalokohs=no }}--RJackson 03:53, 2 July 2010 (UTC)


I have done it. The script I have is in 2 files. 1 file (allweapons.php) defines the items and their ID, the 2nd file (parsexml.php) parses the XML and turns it into Template:User_weapon_checklist code. I hope this helps toward my original suggestion of an automagically updating weapon checklist.
Linked to pastebin because using the code tags eliminates the line breaks.
[parsexml.php] [allweapons.php]
RJackson 05:05, 2 July 2010 (UTC)