// ==UserScript==
// @name         Զ
// @namespace    http://tampermonkey.net/
// @version      0.2.0
// @description  Զȡ裬ԶȴԶ͵Ļȡʣ֧㱦 get the yuwan from douyu automatically.Support yuxiu.douyu.com by the way.
// @author       Chuck
// @match        https://www.douyu.com/*
// @match        http://www.douyu.com/*
// @match        https://yuxiu.douyu.com/*
// @match        http://yuxiu.douyu.com/*

// @icon         http://www.douyu.com/favicon.ico
// @grant        none
// ==/UserScript==



if(location.host==="www.douyu.com")
{
    console.log("ԶȡѾ");
    
    setInterval(function(){
        $peck = $(".peck");
        if($peck.prop("style").display==="block"&&$peck.hasClass("peck-open"))  {
            $(".peck-cdn").click();
        }  


    }, 500);
}
else{
    console.log("ԶȡѾ");
    
    setInterval(function(){
        $peck = $(".gift-peck");
        if($(".gift-peck").prop("style").display==="block"&&$(".gift-peck").hasClass("gift-peck-open"))  {
            $(".gift-peck-cool").click();
        }  

    }, 500);


}
   


//sendingInterval ΪĻͼ300000 = 300룬޸
//͹ѾãҪ뽫4пͷ"//"ɾȥ

//var sendingInterval = 300000;
//setInterval(function(){
//	$(".cs-textarea").val(Math.ceil(Math.random()*100));
//	$(".b-btn").click();
//}, sendingInterval);