tiny wechat robot
1.0.0
Use code hijack and code injection (phantomjs_wechat.js) to implement a simple WeChat robot application.
PATH
npm run serve
npm run wechat
(open a new Terminal Tab to execute this command)ping
test message to the currently logged in user and you should automatically receive a pong
response. Tested with node v7.7.3
and PhantomJS V 2.1.1
: phantomjs-2.1.1-macosx.zip or phantomjs-2.1.1-linux-x86_64.tar.bz2
Currently, it is the simplest ping-pong
response robot (the core code is wechat_injection.js), which sends a message to当前登录用户
:
ping
, reply pong
;pingping
, reply pongpong
;pingpingping
, reply pongpongpong
;networkRequest.changeUrl()
Forwarded as native script wechat_injection.js;angular.bootstrap
and mounts custom hooks so that WeChat chat information can be monitored. At the same time, loading and executing the original WeChat index js at the end of the script requires special processing for the special ECMA language features (currently only one let
has problems, which has been replaced with var
).Use any proxy software, such as Charles Proxy, or the chrome browser plug-in trumpet to forward resource requests.
loadOriginalScript()
in wechat_injection.js will encounter cross-domain request restrictions in Chrome. You can modify the code directly, download the original script and add it to the file.