wtf_wikipedia
wtf_wikipedia copied to clipboard
use siteInfo instead of hard code protocol and interwiki
related to issue #275
In wtf_wikipedia.js
, interwikis
and site_map
can be retrieved from site info .query.interwikimap
The regexp /\[(https?|news|ftp|mailto|gopher|irc):\/\/[^\]\| ]{4,1500}([\| ].*?)?\]/
is used multiple times. It should be a constant. The allowed protocols can be retrieved from site info.query.protocols
if you wanted to move the protocol regexp, pr's welcome