Coder Social home page Coder Social logo

locwechat2's Introduction

locWechat2

全球主机论坛新帖企业微信推送 最终效果

Sample

Sample

介绍

自己去申请企业微信,不依赖于第三方服务公共账号
微信企业号参考了这个大佬文章 https://github.com/kaixin1995/InformationPush

1、申请企业微信公共账号

  • 申请一个微信企业号,名字随意,记住企业ID

  • 然后点击顶部的应用和小程序,,选择创建应用 创建应用
    创建应用

  • 创建应用后,记住AgentId和Secret 创建应用

  • 修改send.php,在对应的位置填写企业ID、Secret、AgentId。 分别在代码的6、8、10行修改

    企业微信测试推送:http://域名/send.php?msg=测试提交

2、下载以及保存推送新帖脚本

下载脚本执行,执行前记得16行修改为你的推送地址

创建应用

wget https://raw.githubusercontent.com/bjtest3/locWechat2/master/toWechat.py

pip install beautifulsoup4
pip install js2py
pip install request

python toWechat.py

3、应对特殊意外,用这个脚本守护一下

vi listen.sh
chmod +x listen.sh

#!/bin/sh

source /etc/profile
retDesc=`ps -ef | grep "toWechat" | grep -v grep`
retCode=$?
if [ ${retCode} -ne 0 ]; 
    then
    echo "`date` restart" >> /root/wechatlisten.log 
    nohup python /root/toWechat.py & 
else
    echo "server on"
fi

加入到定时任务

crontab -e
*/5 * * * * /root/listen.sh

locwechat2's People

Contributors

loveqianool avatar bjtest3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.