Sandbox: Difference between revisions

From Nodeka Wiki
Jump to navigation Jump to search
m (Blanked the page)
Tag: Blanking
No edit summary
 
Line 1: Line 1:
<html>
<div>
const axios = require('axios')
const https = require('https');


const req = axios.create({
  httpsAgent: new https.Agent({ 
    rejectUnauthorized: false
  })
});
req.get('https://www.nodeka.com')
.then((response) => {
    const strings = response.data.split("\n")
    const playerRegex = /<font color="white"><strong>(\d+)<\/strong><\/font>/
    strings.forEach((string) => {
      const found = string.match(playerRegex);
      if (found) {
        console.log("found", found[1]); // eslint-disable-line
      }
    })
})
.catch((error) => {
console.error(error)
});
</div>
</html>

Latest revision as of 14:03, 1 October 2020

const axios = require('axios') const https = require('https'); const req = axios.create({ httpsAgent: new https.Agent({ rejectUnauthorized: false }) }); req.get('https://www.nodeka.com') .then((response) => { const strings = response.data.split("\n") const playerRegex = /(\d+)<\/strong><\/font>/ strings.forEach((string) => { const found = string.match(playerRegex); if (found) { console.log("found", found[1]); // eslint-disable-line } }) }) .catch((error) => { console.error(error) });