Wechat sends messages automatically

Premise:
Today, I joined the wechat assistant army. Why do I have to go to the group to advertise all the time? It's lazy and annoying!!!
So I wonder if I can automatically advertise~

Yes ~ ha ha

Scheme:
Looking at api documents recently, I first thought about whether java can simulate sending information, but I have no idea (give up)
Then Baidu obtained relevant information
① Script wizard recording (directly, this is not the style of your own programming)
② Wechat Web Version (js script)

General idea:
1. Traverse the friends list (avoid sending mistakes, all groups to be sent in groups are set at the top)
2. Modify input box text
3. Click send
4. Timing operation^_^

Completion~

Here is the code

        function show() {
        //Traverse the list of topping. From 1, change the number of i to (0 is the boundary)
            for(var i = 1; i < 2; i++) {
            //Click the friends list in turn to switch between different input boxes
                document.getElementsByClassName("panel")[0].children[4].children[0].children[0].children[1].children[i].children[0].click();
                //Modify output in box
                $('.edit_area').html(
                    "<img class=\"emoji emoji1f449\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\">    33 Received from Jiangsu    <img class=\"emoji emoji1f448\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\"><br><img class=\"emoji emoji1f449\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\">    33 Received from Jiangsu    <img class=\"emoji emoji1f448\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\"><br><img class=\"emoji emoji1f449\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\">    33 Received from Jiangsu    <img class=\"emoji emoji1f448\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\"><br><img class=\"emoji emoji1f449\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\">    33 Received from Jiangsu    <img class=\"emoji emoji1f448\" text=\"_web\" src=\"/zh_CN/htmledition/v2/images/spacer.gif\"><br><br>     Fast. stable. Second second"
                );
                //Analog send by return
$(".edit_area").trigger($.Event("keydown", {
                    keyCode: 13,
                    ctrlKey: true
                }));
                $('.btn_send').click();
            }
        }
        //Every x seconds
        var sh;
        sh = setInterval(show, 3000);

Finally, execute on the console

Tags: emoji Java Programming

Posted on Mon, 04 May 2020 03:39:26 -0400 by bluto374