Wikipedia:Lua/Requests

From Wikipedia, the free encyclopedia
Jump to: navigation, search
  WP:Lua
Project
  WT:Lua
Project talk
  Help
 
  To do
 
  Requests
 
  Resources
en: m: mw: external
 
Shortcuts:

Lua scripts on Wikipedia are similar to templates but useful for performing more complex tasks for which templates are too complex or slow. Common examples include numeric computations, string manipulation and parsing, and decision trees. You can use this page to request help from Lua developers in writing a Lua module for a specific task on Wikipedia or another Wikimedia Foundation project. Both debugging help and full implementation are available.

To start a request, just make a new section below and describe what you need. You may wish to first check Special:PrefixIndex/Module: to see if you can find a suitable existing script.

It may help developers to provide examples of where the task is likely to be useful within Wikipedia. If the proposal would replace or improve upon existing templates, please note which ones.

Is it possible to get the dates of modification for files (in this case, files on Commons)?[edit]

Previously, I pinged some users to bring attention to this discussion. Their attention was no longer needed after the reply below. Sorry for the inconvenience.
Right now, Commons has a collection of war maps which are frequently updated using data from collaboration which happens on the English Wikipedia for each map. A problem exists where the date these war map images were last updated needs to be distributed to articles which use the maps, so that users can know how up-to-date they are ("current as of 10 Nov 2015" or something). This problem is currently being solved using this module which might as well be a template and has to be manually updated. Is it possible, using Lua, to automate the retrieval of this date, or possibly generalise it to any file so that future maps can also have this convention applied to them? If it isn't possible using lua, I'm strongly considering writing a bot which does this automatically. Thanks in advance. --BurritoBazooka (talk) 02:07, 10 November 2015 (UTC)

@BurritoBazooka: No, this isn't possible at the moment. You can see the file metadata available to Lua here, but the time of last update isn't in there. The closest we have is {{REVISIONTIMESTAMP: File:filename}}, but that only works for files on the local wiki, and it also includes edits to the file description page as well as new uploads. If that works for you, you can call it from Lua using frame:callParserFunction('REVISIONTIMESTAMP', 'File:Filename'). Best — Mr. Stradivarius ♪ talk ♪ 02:46, 10 November 2015 (UTC)
Ah, thanks for the reply. --BurritoBazooka (talk) 02:49, 10 November 2015 (UTC)