// ==UserScript==
// @name aviso.bz
// @namespace http://tampermonkey.net/
// @version 1
// @description 1
// @match https://aviso.bz/*
// @match https://twiron.com/*
// @require https://code.jquery.com/jquery-3.6.0.min.js
// @grant unsafeWindow
// ==/UserScript==
(async function() {
'use strict';
/* global $ */
const myEmail = '';
const myPassword = '';
if (window.location.hostname === 'aviso.bz')
{
if (window.location.pathname === '/tasks-surf')
{
$('div:hidden').remove(); //БЛОК ВЫСОТОЙ НОЛЬ ВСТАВЛЯЕТ ПАЛКИ В КОЛËСА
if($('span:contains("Нет ссылок доступных для просмотра")').length > 0)
{
return;
}
else
{
window.addEventListener('focus', function(){location.reload();});
}
$('h1:contains("Динамические ссылки.")')
.nextAll('div:visible').first()
.find('a:first')
//.css('background', 'orange')
.click();
let startWatch = setInterval(function()
{
if($('a.start-yes-serf').length > 0)
{
clearInterval(startWatch);
let url = $('a.start-yes-serf').attr('onclick');
url = url.split("'");
url = url[1];
window.open(url);
}
},500);
}
}
if (window.location.hostname === 'twiron.com')
{
let waitTimer = setInterval(function()
{
//console.info('ЖДËМ...');
const frame = document.querySelector('frame[name="frminfo"]');
if (frame) {
// Ждём загрузки фрейма
frame.onload = function() {
try {
// Получаем документ фрейма
const frameDoc = frame.contentDocument || frame.contentWindow.document;
// Ищем все ссылки в фрейме
const links = frameDoc.getElementsByTagName('a');
// Перебираем ссылки и ищем нужную
for (let link of links) {
if (link.textContent.includes("Подтвердить просмотр")) {
// Кликаем по найденной ссылке
link.click();
// Закрываем вкладку после небольшой задержки
setTimeout(() => window.close(), 1400);
//break; // Прерываем цикл после клика
}
}
} catch (e) {
console.error("Ошибка доступа к фрейму:", e);
}
};
// Если фрейм уже загружен, вызываем обработчик сразу
if (frame.contentDocument && frame.contentDocument.readyState === "complete") {
frame.onload();
}
}
},1000);
}
if (window.location.pathname === '/tasks-letter')
{
$('div:hidden').remove(); //БЛОК ВЫСОТОЙ НОЛЬ ВСТАВЛЯЕТ ПАЛКИ В КОЛËСА
if($('span:contains("Нет ссылок доступных для просмотра")').length > 0)
{
return;
}
else
{
window.addEventListener('focus', function(){location.reload();});
}
$('h1:contains("Чтение рекламных писем")')
.nextAll('div:visible').first()
.find('a:first')
.css('background', 'orange')
.click();
let startRead = setInterval(function()
{
const read = $('a:contains("Приступить к чтению"):visible');
if (read.length > 0)
{
clearInterval(startRead);
read.css('background', 'orange')
.click();
}
},500);
}
if (window.location.pathname === '/login')
{
$('input[placeholder="Email или login"]').val(myEmail);
$('input[type="password"]').val(myPassword);
$('button:contains("Войти в аккаунт")').click();
}
if (window.location.pathname === '/go/view.php')
{
let videoTimer = setInterval(function(){
if($('span:contains("Пожалуйста, ждите окончания отсчета таймера"):visible').length === 1)
{
//console.info('ЖДËМ ТАЙМЕР ВИДЕО...');
}
else
if ($('span:contains("Задача выполнена. На ваш счет начислено"):visible').length === 1)
{
clearInterval(videoTimer);
window.close();
}
else
if ($('span:contains("Ошибка просмотра"):visible').length === 1)
{
clearInterval(videoTimer);
window.close();
}
},1000);
const inject=`
setInterval(function(){
timerVideo = 1;
var iframe = document.querySelector("#video-start");
iframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
},1000);
`;
$('html').append('<script>'+inject+'</script>');
}
if (window.location.pathname === '/tasks-youtube')
{
setInterval(function(){
if (!document.hidden) {
//console.info('Вкладка в фокусе');
$('span:contains("Посмотреть видео"):first').css('background','orange').click();
}
},1000);
}
})();