Hello, I've set up a script that makes use of the API to shorten URLs right from a spreadsheet, and I was surprised to find that the $wgUrlShortenerAllowedDomains is not tested then. I could shorten just about anything as long as it was a valid URL.
For what it's worth, here is the script (to be used from within Google Spreadsheet:
/**
* Function that returns a shorten URL from a wiki URL
*/
function shortenURL(input) {
// See https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object)
var options = {
'method' : 'post',
'contentType': 'application/json'
};
var response = UrlFetchApp.fetch('https://mywiki.fr/api.php?action=shortenurl&format=json&url=' + encodeURIComponent(input), options);
var json = response.getContentText();
var data = JSON.parse(json);
// {"shortenurl":{"shorturl":"3perf.fr/r/7"}}
// {error={info=Not a valid URL}}
Logger.log(data);
Logger.log("https://" + data["shortenurl"]["shorturl"]);
if (data["error"])
throw data["error"]["info"];
return "https://" + data["shortenurl"]["shorturl"];
}