Extension:External Data/Local programs

You can use External Data to retrieve data returned by a program run server-side. There are two ways to do this: by calling   (or its Lua equivalent), or by calling a custom tag, defined with the  field in the data source definition, which handles both the retrieval and display of the data (the tag emulation mode). One advantage of the latter approach is that it allows for outputting raw HTML (most importantly, SVG); see the "Tag emulation mode" below for how to do it.

Remember that /  in standalone mode or   can replace   parser function, as well as   can replace   Lua function.

Simple example
A simple example, involving only text processing, is below: and

Tag emulation mode
Below is a more complicated example using tag emulation mode:

Usage
After a program is configured, it can be invoked in tag emulation mode: pair.

This mode outputs raw unwikified data and is suitable for embedding SVG.

Parameters
All of the parsing-related parameters that #get_web_data supports (format, delimiter, use xpath, etc.) can be used for #get_program_data as well; see.

The caching-related parameters (cache seconds and use stale cache) and settings that #get_web_data supports can be used for #get_program_data as well; see.

So can be :  and.

Limitations
Due to the way that Shell framework quotes each component of a shell command, piping cannot be used. A shell script should be created to wrap a pipeline.

Caution
Although programs are run in a restricted environment by, wiki admins should exercise great caution while configuring programs to make them callable with #get_program_data.

A set of tested examples can be found here and (with working output) here.