// ==UserScript==
// @name Adviev Automated
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically view adds, grab the video code and claim earnings
// @author Dotun Showunmi (dotsonshow)
// @match https://adviev.com/bapads/*
// @icon http://adviev.com/img/logo.png
// @grant none
// ==/UserScript==
(function() {
'use strict';
setInterval(function() {
if
(window.location.href.includes('https://adviev.com/bapads/paidcounter/')){
setTimeout(function() {
window.close();
}, 20000);
}
let earnBtn = document.querySelector('div.bap-ads-content.bannhgt.surf_box0
> div > a')
if (earnBtn == null || earnBtn == "undefined") {
console.log('its ptc not video')
document.querySelector('div.bap-ads-content.bannhgt > div > a').click()
}
let divInputVideoId = document.querySelector('div.bap-ads-
content.bannhgt.unik_key_box0.ptcvsurf1')
let videoIdField = document.querySelector('#u_key0')
let confrmBtn = document.querySelector('div.bap-ads-
content.bannhgt.unik_key_box0.ptcvsurf1 > input')
let videoId = earnBtn.getAttribute('onclick').split(',')[4].slice(1, 5)
divInputVideoId.style.display = 'flex'
videoIdField.value = videoId
confrmBtn.click()
}, 10000)
})();