iiideep / weixin-caiji Goto Github PK
View Code? Open in Web Editor NEWThis project forked from hani1990/weixin-caiji
微信公众号采集系统-脚本
This project forked from hani1990/weixin-caiji
微信公众号采集系统-脚本
首先要感谢飯口組組長 把他的采集方案开源出来 https://zhuanlan.zhihu.com/p/24302048 这里能够称之为系统是因为涉及到的技术很多,这里一一罗列: 1、anyproxy 阿里巴巴开源的代理拦截器,使用的是4.0的版本,可以很方便的修改 response 信息。anyproxy 我在系统中已经安装好了,安装也很简单,先安装nodejs环境,然后用npm安装anyproxy. anyproxy 4.0开始规则可以作为模块来开发,写好了规则代码之后,不用动原来的代码,只需要在anproxy的参数带上规则文件。这里用到的命令 anproxy --rule weixin.js。 关于anproxy如何设置https 证书问题,可以参考官网。我在虚拟机中设置了全局的代理,所以需要 anyproxy 打开8001端口后所有的http请求才能成功。 规则代码主要的逻辑是对于微信公众号的请求进行拦截,把数据转发到 php。 2、apache+php+mysql 这里主要是作为web服务器来处理anyproxy 拦截的请求,处理微信文章数据和点赞数、阅读数。 拦截过来的数据的处理可以看具体的php代码,逻辑不算太复杂。这里为了方便使用的是phpstudy的集成开发环境 (自己搭建环境的话可以用其他的软件)。 3、按键精灵,按键精灵是国产的一种类似vb语法的模拟键盘鼠标的工具。这里用到按键精灵来模拟点击windows下的微信客户端。 在处理多个微信公众号的时候,需要客户端来点击,把所有的手动操作通过按键精灵来模拟出来。去查看具体的代码的时候,我在处理点击历史消息使用了一个小技巧,事实是开始想通过直接通过识别图片的办法来找到 “历史消息” 按钮的位置,但是发现怎么也找不到,然后只能 循环向下移动鼠标,直到区域内找到特定的颜色,就是“历史消息”按钮。 在一条思路行不通的时候,就要尝试其他思路。整个系统就是做下来,就是要处理这种看似行得通,实际不通,然后再去尝试,如此反复。 4、windows 微信客户端,其实我尝试过用安卓模拟器,因为我的目标是开箱即用,所以需要把所有的程序都能够装到一起,但是在虚拟机中是没法安装安卓模拟器,也就是说虚拟机中是没法做二次虚拟的。这个坑我已经踩过了,大家就不用踩了,记得之前有人问过,阿里云windows服务器能不能装 安卓模拟器,我想答案是一样的,虚拟机不能做二次虚拟化,阿里云windows服务器不能装安卓模拟器。 所以,当我尝试安卓模拟器后,发现原来微信pc客户端(包括mac)的功能已经做的很完善了,然后就去尝试windows客户端。 在安装使用过程中可以遇到问题可以加我的微信: liuhan199012 -------------------------------------------------------------------------------------------------------- npm install -g anyproxy@beta anyproxy-ca #生成rootCA证书,生成后需要手动信任 anyproxy --intercept #启动AnyProxy,并解析所有https请求 Ubuntu下添加系统根证书, 只要将证书(扩展名为crt)复制到**/usr/local/share/ca-certificates**文件夹然后运行update-ca-certificates即可 添加证书: $sudo cp 证书路径.crt /usr/local/share/ca-certificates $sudo update-ca-certificates #anyproxy 启动 anyproxy -i #rule_default.js 路径 /usr/local/lib/node_modules/anyproxy/lib windows: C:\Users\Administrator\AppData\Roaming\npm\node_modules\anyproxy\lib anyproxy -i --rule ./weixin.js npm install -g pm2 npm install -g urllib-sync ps aux|grep anyproxy | grep -v 'grep'|awk '{print $2}' |xargs kill -9 按键脚本精灵的代码,实现自动点击公众号的历史消息,然后下来历史文章列表。 windows_微信客户端模拟浏览公众号.Q
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.