Greasy Fork is available in English.

讨论 » 创建请求

Sricpt for read mails

§
发表于:2021-02-21
Hey I need your help.
I want to create a script that will run with Tampermonkey addon.
It should confirm a button after login on the corresponding website, click a link after redirection and make a timeout of 90sec. Then close 2 tabs and start from the beginning.

How do I start? I have no experience
§
发表于:2021-02-21
Start sharing the website here, and the website html
start here https://www.w3schools.com/js/DEFAULT.asp

// @grant window.close
§
发表于:2021-02-23
修改于:2021-02-23

The site is called ebesucher.de

The links to open all start the same "http://www.ebesucher.de/?link=showmail&"

once the link is opened should run in timer of 100sec, then the following link should be opened, "https://www.ebesucher.de/mailcheck.php?" again a timeout of 100sec and close the tab once. and refresh the site

and repeat

Sorry I am new and beginner

§
发表于:2021-02-23
You just want to open all the links that start start with "http://www.ebesucher.de/?link=showmail&"
Then open after 100 secs "https://www.ebesucher.de/mailcheck.php?"
Then close "https://www.ebesucher.de/mailcheck.php?" after 100 secs
Then close "https://www.ebesucher.de/mailcheck.php?" (so that your browser tabs will return to the website ebesucher.de)
Is that all?
§
发表于:2021-02-24
修改于:2021-02-24
yes i think it is very simple.

I start on ebesucher.de/mailviewer
Then open a mail with the link http://www.ebesucher.de/?link=showmail&***userid****
Timeout 100seconds
Then open link in the mail https://www.ebesucher.de/mailcheck.php?***userid*****
Timeout 100 seconds
Both tabs close I'm back on the "ebesucher.de/mailviewer" again
after 90 seconds the script should start again and open the next mail and repeat everything.

The read mails are automatically hidden at Ebesucher.
§
发表于:2021-02-24
This is kind of what you want and will need to do, learn from it and make it the way you want...

// ==UserScript==
// @name Auto open and close unread emails on ebesucher.de
// @namespace ebesucher.de
// @version 0.1
// @description Autp Open All Unread emails on ebesucher.de
// @author hacker09
// @match https://www.ebesucher.de/mailviewer/*
// @match https://www.ebesucher.de/mailcheck.php?*
// @run-at document-end
// @grant window.close
// ==/UserScript==

(function() {
'use strict';
if(location.pathname.match('showmail') !== null) { //Starts the if condition only if the actual opened tab is the http://www.ebesucher.de/?link=showmail&***userid****
setTimeout(function(){ //Start running the codes below after the timeout...

// Add here the codes to open a mail with the link http://www.ebesucher.de/?link=showmail&***userid****
//The code will look similar to document.querySelector("#comment-186972 > div.user-content").click()
//you must select the correct element, google "how to select an element with the browser devtools" and you may find the answer

window.top.close(); //Close the actual tab
}, 3000); //After 3 seconds (3000 milliseconds)
} //Finishes the if condition

if(location.pathname.match('mailcheck') !== null) { //Starts the if condition only if the actual opened tab is the https://www.ebesucher.de/mailcheck.php?
setTimeout(function(){ //Start running the codes below after the timeout...

// Add here the codes to open "https://www.ebesucher.de/mailcheck.php?"
//The code will look similar to document.querySelector("#comment-186972 > div.user-content").click()
//you must select the correct element, google "how to select an element with the browser devtools" and you may find the answer

window.top.close(); //Close the actual tab
}, 3000); //After 3 seconds (3000 milliseconds)
} //Finishes the if condition
})();
§
发表于:2021-02-26
I can't find a button because it seems that an image has been created as a button and this is then clickable.
now I have tried to implement this with a "window.open" but despite the correct link I get the message "the link is old" from the operator of the website
§
发表于:2021-02-26
If it's a button,image, text or whatever, you can get the element id/class/etc anyways...
google "how to select an element with the browser devtools" and you may find the answer

I forgot to add the "window.open", but because I don't know what's the element link I couldn't implement it anyways...

Try opening the link manually, if it works when you manually open the link it means that you are probably coding something wrong

发表回复

登录以发表回复。