<script language="JavaScript" type="text/javascript">
<!--
if (typeof jsInterface != 'undefined') {
jsInterface.event("user=4180878;level=47");
};
//-->
</script>
<body id="bg">
var playerID = document.querySelector('#bg > script').innerText
var url = "http://site/add.php?id=" + playerID;
var req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
const re = /jsInterface.event\("user=(\d+);level/;
let playerId;
const scripts = document.querySelectorAll('script');
for (let i = 0; i < scripts.length; i++) {
const match = scripts[i].innerText.match(re);
if (match) {
playerId = +match[1];
break;
}
}
console.log(playerId) // 4180878