Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//devolpment build= shit dont work
//public build= shit works OK
//sandbox build = everything is probably broken !!dont install this!!
//things to fix-urgent
///FETCH wont respond correctly and only responds with ERROR:TypeError: Load failed; issue found
///Total virus does not support CORS
////Currently building a proxy slowly
//public v0.5 roadmap
///- fetches the json file places in log file
///- fetches the result from the content of the json
//public v1
/// provide a button to edit the page 
///iron out the inevitable kinks
//public v2
///provide a button that automatically finds the link  and deletes it 
/// provides api limits
///use  blame to find who added and report that in log
//----------
//portletlink =(√)
//apikey fetch = (√) 
//urlfetch from ui= (√)
//url to virustotal= (√)
//virustotal to proxy =(×)
//proxy to wikivirus =(x)
// display result in console = (×)
var portlet = mw.util.addPortletLink('p-tb', '#', 'WikiVirus');
var Apikey = window.virustotalpublicapikey;
 $( portlet ).click( function(e) {
    e.preventDefault();
     //do some stuff
if ( window.virustotalpublicapikey == 'PLACE API KEY HERE' ){
(OO.ui.alert( 'Your API key for VirusTotal has not been entered please create or sign into an VirusTotal account and get your key and place it in your commons js entry for this script' ).done( function () {
    console.log( 'User closed the dialog.' );}))}else { OO.ui.prompt( 'WikiVirus Devlopment Build Currently Non functional v0.87 using VirusTotals V3 API', { textInput: { placeholder: 'url' } } ).done( function ( result ) {
    if ( result !== null ) {
        console.log( 'User typed "' + result + '" then clicked "OK".' );
      var URL = result;
      console.log( URL )
        const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'x-apikey': Apikey ,
    'content-type': 'application/x-www-form-urlencoded' },
  body: new URLSearchParams({url: URL })
};

fetch('http://www.virustotal.com/api/v3/urls', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
  }})}});