Wikipedia Interwiki

<head>
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
<!-- Branches' info -->
<script type="text/javascript" src="http://topia.wikidot.com/local--code/php-interwiki-test/4"></script>
<style>
body {font-family: sans-serif;font-size: .8em;margin: 0;}
.head {
    background: #eaecf0;
    color: #72777d;
    padding: 0.75em 1em;
}
div[data-o] a {
    background: #fff;
    border-bottom: 1px solid #eaecf0;
    display: block;
    padding: 0.75em 1em;
    text-decoration: none;
}
div[data-o] a span {
    color: #000;
    display: block;
    font-weight: bold;
}
div[data-o] a span + span {
    color: #72777d;
    font-weight: normal;
}
</style>
 
<!-- PageLookupQModule -->
<script type="text/javascript" src="http://topia.wdfiles.com/local--code/getwikimodule/1"></script>
 
<!-- C-take's resizing iframe method -->
<script type="text/javascript" src="http://shitake-crude-production.wdfiles.com/local--code/extension%3Aifarame-htmlblock/1"></script>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<div id="output"></div>
<script type="text/javascript">
var id = (v) => document.getElementById(v);
var IntKeys = Object.keys(IntData);
var getURL;
var elem = id("output");
var baseURL = decodeURIComponent(document.location.href).split("#")[1].split("?");
var siteLang = baseURL[0];
var thisSite= IntData[siteLang];
var siteID = thisSite ? thisSite["id"] : false;
var pagename = baseURL[1].split(thisSite["category"]).join("");
var header = thisSite["head"];
 
/* FIRE! */
 
function getDataAll(){
    var a = new Date(),
    af = (v) => v < 10 ? "0" + v : v,
    ay = a.getFullYear(),
    amo = af(a.getMonth() + 1),
    ad = af(a.getDate()),
    ah = af(a.getHours()),
    ami = af(a.getMinutes()),
    as = af(a.getSeconds()),
    time = ay + "/" + amo + "/" + ad + " " + ah + ":" + ami + ":" + as;
    elem.innerHTML += `<div class="head">${header} (<span id="cnt">0</span>)</div>`;
    for(var i = 0; i < IntKeys.length; i++) {
        var obj = IntData[IntKeys[i]];
        getData(obj["url"], obj["name"], obj["id"], obj["title"], obj["category"] + pagename, IntKeys[i], obj["sp"]);
    }
    for(var i = 0; i < 6; i++) {
        setTimeout(elemSort, 1000 * i + 1000);
    }
}
 
function getData(a, b, c, d, e, f, g){
    getWikiModule({
        site_id: c,
        query: e,
        function: (res) => {
            for(var i = 0; i < res.length; i++) {
                 if(res[i].unix_name == e) {
                     elem.innerHTML += `<div data-o="${g ? g : "official"}" class="ct-${f}"><a href="${a + e}" target="_parent"><span>${b}</span><span>${res[i].title}</span></a></div>`;
                     id("cnt").innerHTML = Number(id("cnt").innerHTML) + 1;
                 }
            }
        }
    });
}
 
var sortList, sortAry;
function elemSort() {
    try{
        sortList = document.querySelectorAll('[class*="ct-"]');
        sortAry = Array.prototype.slice.call(sortList);
        function compareText(a,b) {
            var nm = (v) => v.className.replace("ct-", "");
            var idx = (v) => IntKeys.indexOf(v);
            if(idx(nm(a)) > idx(nm(b))) {
                return 1;
            }
            else if(idx(nm(a)) < idx(nm(b))) {
                return -1;
            }
            else {
                return 0;
            }
        }
        sortAry.sort(compareText);
        for (var i = 0; i < sortAry.length; i++) {
            elem.appendChild(elem.removeChild(sortAry[i]))
        }
    }catch(e){}
}
 
getDataAll();
</script>
<div id="iframeset"></div>
</body>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License