2 # Copyright (C) 2005 Ævar Arnfjörð Bjarmason
8 my $map = &get
(&url
('http://usemod.com/intermap.txt'));
12 my @map = split /\n/, $map;
15 # Note: this file is generated by maintenance/fetchInterwiki.pl
16 # Edit and rerun that script rather than modifying this directly.
18 /* private */ $wgValidInterwikis = array(
21 $cont .= "\t# The usemod interwiki map\n";
22 for (my $i=0;$i<=$#map;++$i) {
23 my ($name, $url) = $map[$i] =~ m
#^([^ ]+) (.+)#i;
24 $cont .= "\t'$name' => '$url\$1',\n";
28 aa ab af als am ar as ay az ba be bg bh bi bn bo bs ca chr co cs csb cy da de dk:da dz el en eo
29 es et eu fa fi fj fo fr fy ga gd gl gn gu gv ha he hi hr hu hy ia id ik io is it iu ja jv ka kk
30 kl km kn ko ks ku ky la lo lt lv mg mi mk ml mn mo mr ms my na nah nb nds ne nl no oc om or pa
31 pl ps pt qu rm rn ro ru rw sa sd sg sh si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk
32 tl tn to tp tpi tr ts tt tw ug uk ur uz vi vo wa wo xh yi yo za zh zh-cn zh-tw zu);
35 # Some custom additions:
36 "ReVo" => "http://purl.org/NET/voko/revo/art/$1.html",
37 # eg [[ReVo:cerami]], [[ReVo:astero]] - note X-sensitive!
38 "EcheI" => "http://www.ikso.net/cgi-bin/wiki.pl?$1",
39 "E\\xc4\\x89eI" => "http://www.ikso.net/cgi-bin/wiki.pl?$1",
40 "UnuMondo" => "http://unumondo.com/cgi-bin/wiki.pl?$1", # X-sensitive!
41 "JEFO" => "http://esperanto.jeunes.free.fr/vikio/index.php?$1",
42 "PMEG" => "http://www.bertilow.com/pmeg/$1.php",
43 # ekz [[PMEG:gramatiko/kunligaj vortetoj/au]]
44 "EnciclopediaLibre" => "http://enciclopedia.us.es/wiki.phtml?title=$1",
46 # Wikipedia-specific stuff:
48 "w" => "http://www.wikipedia.org/wiki/$1",
49 "m" => "http://meta.wikipedia.org/wiki/$1",
50 "meta" => "http://meta.wikipedia.org/wiki/$1",
51 "sep11" => "http://sep11.wikipedia.org/wiki/$1",
52 "simple"=> "http://simple.wikipedia.com/wiki.cgi?$1",
53 "wiktionary" => "http://wiktionary.wikipedia.org/wiki/$1",
54 "PageHistory" => "http://www.wikipedia.org/w/wiki.phtml?title=$1&action=history",
55 "UserContributions" => "http://www.wikipedia.org/w/wiki.phtml?title=Special:Contributions&target=$1",
56 "BackLinks" => "http://www.wikipedia.org/w/wiki.phtml?title=Special:Whatlinkshere&target=$1",
58 # ISO 639 2-letter language codes
61 for(my $i=0; $i<=$#iso;++$i) {
62 my @arr = split /:/, $iso[$i];
64 $cont .= "'$arr[0]' => 'http://";
71 $cont .= ".wikipedia.org/wiki/\$1',\n";
79 open IW
, ">Interwiki.php";
84 my ($host, $url) = @_;
88 my $proto = getprotobyname('tcp');
89 socket(Socket
, AF_INET
, SOCK_STREAM
, $proto);
90 my $iaddr = inet_aton
("$host");
91 my $port = getservbyname('http', 'tcp');
92 my $sin = sockaddr_in
($port, $iaddr);
93 connect(Socket
, $sin);
94 send Socket
, "GET $url HTTP/1.0\r\nHost: $host\r\n\r\n",0;
96 $cont .= $_ if $eat; # mmm, food
97 ++$eat if ($_ =~ /^(\n|\r\n|)$/);
102 sub url
{my ($server, $path) = $_[0] =~ m
#.*(?=//)//([^/]*)(.*)#g;}