I have a website (not my own) to earn bitcoins every 60 min. So i have to click on roll button every 60 min. So i made a Siri shortcut to do it without opening Safari with scriptable. I have the code but when I put the code on Google Chrome Console its work perfectly and when I put it on Siri Shortcut I get this error:
ReferenceError
can't find variable$
The code i have used :
(function() {
'use strict';
$('.roll-button').click(function() {
window.onload = timedRefresh(4000);
document.onkeydown = function() {
if (event.keyCode == 116) {
event.keyCode = 0;
event.returnValue = false;
}
}
});
// set time out 5 sec
setTimeout(function(e){
$('.roll-button').trigger('click');
}, 4000);
e.stop();
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
})();