User:Nyakase/Scripts/twinkle-autoip.js

$(document).on("click", "#friendly-shared", async function {   $("input[name=organization]").val("Loading...");    $("input[name=host]").val("Loading...");    const request = await fetch(`https://ipinfo.io/${mw.config.get("wgTitle")}/json`);    const json = await request.json;    if (json.org && json.org.search(" ") > 0) { $("input[name=organization]").val(json.org.split(" ").splice(1).join(" ")); } else { $("input[name=organization]").val(""); }    if (json.hostname) { $("input[name=host]").val(json.hostname); } else { $("input[name=host]").val("");} });