G2A Many GEOs
SHARE
TWEET

Untitled

a guest Mar 30th, 2020 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var xhrTracker = new XMLHttpRequest();
  2.     xhrTracker.onreadystatechange = function(){
  3.         if (xhrTracker.readyState === 4)
  4.         {
  5.             var data;
  6.             try {
  7.                 data = JSON.parse(xhrTracker.responseText);
  8.             } catch(e) {
  9.                 console.log(e);
  10.             }
  11.             console.log(data);
  12.             if(data.code === 200)
  13.             {
  14.                 var byDay = data['data']['data'][0]['tracker_total_by_day'];
  15.                 var oDate = new Date();
  16.                 var nHrs = (oDate.getHours() < 10) ? '0'+oDate.getHours() : oDate.getHours();
  17.                 var nMin = (oDate.getMinutes() < 10) ? '0'+oDate.getMinutes() : oDate.getMinutes();
  18.                 var nDate = oDate.getDate();
  19.                 var nMnth = (oDate.getMonth() < 10) ? '0'+(oDate.getMonth()+1) : (oDate.getMonth()+1);
  20.                 var nYear = oDate.getFullYear();
  21.                 document.querySelector('.red_title').innerHTML = 'Tính đến '+nHrs+'h'+nMin+', '+nDate+'/'+nMnth+'/'+nYear+' (Tổng cộng có '+byDay['cases']+' ca nhiễm)';
  22.                 document.querySelector('.box-thongke .head').innerHTML = 'Tính đến '+nHrs+'h'+nMin+', '+nDate+'/'+nMnth+'/'+nYear+'. <strong>Nguồn: Bộ Y tế</strong>';
  23.                 var byDayEl = document.querySelector('.count-covid');
  24.                 byDayEl.querySelector('.nhiem').innerHTML = '<strong>'+byDay['cases']+'</strong>Nhiễm';
  25.                 byDayEl.querySelector('.tuvong').innerHTML = '<strong>'+byDay['deaths']+'</strong>Tử vong';
  26.                 byDayEl.querySelector('.khoi').innerHTML = '<strong>'+byDay['recovered']+'</strong>Khỏi';
  27.                 document.querySelector('.tracker_positive strong').innerHTML = byDay['cases'];
  28.             }
  29.         }
  30.     };
  31.     xhrTracker.open('GET', "https://gw.vnexpress.net/cr/?name=tracker_coronavirus");
  32.     xhrTracker.send();
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top