Netmozi.com login

Netmozi login script.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Netmozi.com login
// @namespace    https://netmozi.com/login
// @version      19.03.15
// @description  Netmozi login script.
// @author       NMyy
// @match        *://netmozi.com/login
// @grant        none
// ==/UserScript==

var USER = 'XXX'; //set user
var PASS = 'XXX'; //set password

$(document).ready(function() {
    var loginok = document.body.innerHTML.toString().indexOf('Kilépés') != -1;

function sleep(seconds){
    var waitUntil = new Date().getTime() + seconds*1000;
    while(new Date().getTime() < waitUntil) true;
}

    //Ha a login oldalon vagyunk
    if (window.location.href.indexOf("login") != -1)
    {
            if (!loginok) //és még nem vagyunk bejelentkezve
            {
              let usernameElem = document.getElementById('inputName');
              usernameElem.value = USER;
              let passwordElem = document.getElementById('inputPassword');
              passwordElem.value = PASS;
              document.getElementById("loginForm").submit();
              sleep(1);
              window.location.href = 'https://netmozi.com/?page=&order=1&bookmarks=0&search=&genre=&type=1&year_from=&year_to=&language=1&rating_from=0&rating_to=10&quality=&first_letter=&actor=&character=';
            }
            else //már be vagyunk jelentkezve
            {
               window.location.href = 'https://netmozi.com/?page=&order=1&bookmarks=0&search=&genre=&type=1&year_from=&year_to=&language=1&rating_from=0&rating_to=10&quality=&first_letter=&actor=&character=';

            }
    }

});