Created
May 23, 2014 14:46
-
-
Save einverne/d6ab0b350d5e1edcef1b to your computer and use it in GitHub Desktop.
百度知道自动签到,虾米自动签到
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Auto Check | |
// @namespace http://www.einverne.tk/ | |
// @version 2014.05.23 | |
// @description 百度知道自动签到,虾米自动签到 | |
// @match http://zhidao.baidu.com/question/* | |
// @match http://*.xiami.com/* | |
// @copyright 2012+, einverne | |
// ==/UserScript== | |
(function(){ | |
var signInTimer = setInterval ( function() { | |
var signInBtn = document.querySelector ("#signin-btn"); | |
if (signInBtn) { | |
clearInterval (signInTimer); | |
var clickEvent = document.createEvent ('MouseEvents'); | |
clickEvent.initEvent ('click', true, true); | |
signInBtn.dispatchEvent (clickEvent); | |
} | |
var xiamiCheckBtn = document.querySelector(".action"); | |
if(xiamiCheckBtn) { | |
clearInterval(signInTimer); | |
var clickEvent = document.createEvent('MouseEvents'); | |
clickEvent.initEvent('click',true,true ); | |
xiamiCheckBtn.dispatchEvent(clickEvent); | |
} | |
} | |
, 200 | |
); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment