MediaWiki:InstaButton.js

/* eslint-env browser */ (function {  'use strict';

console.log('InstaButton v.0.0.5');

var request = new XMLHttpRequest; request.timeout = 30000; request.ontimeout = function { console.log('Request timed out.'); }; request.onreadystatechange = function  { if (request.readyState === 4 && request.status === 200) { var response = JSON.parse(request.responseText).users[0].user.follower_count; console.log('Followers', response); } };  request.open('GET', 'https://www.instagram.com/web/search/topsearch/?query=attackontitanwiki', true); request.send;

var button = encodeURIComponent(   ' ' +      ' ' +        '' +      ' ' +      ' ' +        ' ' +          '' +            ' @attackontitanwiki' +          '' +          ' 1.2K followers ' +        ' ' +      ' ' +    ' '  ); var iframe = ' '; var div = document.getElementById('instabutton');

div.innerHTML = iframe; });