Last modified: 2014-01-24 01:53:54 UTC
Lua code: -- loads the HTTP module and any libraries it requires local http = require("socket.http") local p = {} function p.main(frame) r, e = http.request("http://wrong.host/") return e end return p Invoke code: {{#invoke:Foo|main}} Expected result: Returned 'host not found' or some like. Actual result: Returned "script error". Rationale: Retrieve API URLs contents using Lua, like it is now possible in JS. Note that there wouldn't be a high additional load, since the module would only be loaded when a Lua module is invoked, and only if it has a relevant require() statement.
Please also install a Lua module to parse JSON or XML, either would do. Of possible relevance: - https://www.mediawiki.org/wiki/Extension_talk:Scribunto/Lua_reference_manual#Access_to_MediaWiki_API.3B_access_to_page_text
Possibly related: * bug 49726 * bug 48176 (In reply to comment #1) > Please also install a Lua module to parse JSON or XML, either would do. "Please also" indicates to me the need for additional bug reports.
Related discussion: - https://en.wikipedia.org/wiki/Wikipedia:Lua_requests#Retrieving_N_latest_category_members
No, we're not going to allow arbitrary socket connections outgoing from WMF servers during the page parse.
In my understanding the socket connections can be limited to Wikimedia projects only (wikimedia.org/*, wikipedia.org/*, etc). Brad Jorsch, is that considered unsafe?
We don't want to be allowing network fetches during the page parse. Not even bug 49726 is likely to happen.