Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hanson/wechat-oa
登录微信公众号并可主动发送消息
https://github.com/hanson/wechat-oa
Last synced: 24 days ago
JSON representation
登录微信公众号并可主动发送消息
- Host: GitHub
- URL: https://github.com/hanson/wechat-oa
- Owner: Hanson
- License: mit
- Created: 2016-05-30T09:25:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T09:51:15.000Z (over 7 years ago)
- Last Synced: 2024-03-14T21:28:16.251Z (8 months ago)
- Language: PHP
- Size: 42 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wechat-oa
模拟登录微信公众号并可主动向24小时内有消息互动的用户主动发送消息# install
composer require hanccc/wechat-oa
# usage
## 普通模式
```
$wechat = new \Hanccc\WechatOA($email, $password);
```## 多例模式
```
$wechat = \Hanccc\WechatOA::getInstance($email, $password);
```### 发送消息
```
$wechat->sendMessage('hello', 'openid');
``````
//或者可以先把token存储起来减少登录时所耗费的时间
$token = $wechat->getToken
$wechat->sendMessage('hello', 'openid', $wechat->getToken());
```