wechat-tools
Advanced tools
Comparing version 0.0.1 to 0.0.2
function wechattools() {} | ||
wechattools.weather = require('./lib/weather'); | ||
wechattools.history = require('./lib/history'); | ||
wechattools.translate = require('./lib/translate'); | ||
module.exports = wechattools; |
{ | ||
"name": "wechat-tools", | ||
"version": "0.0.1", | ||
"description": "wechat 回复小工具 ,包括天气预报、历史今天等实用功能", | ||
"version": "0.0.2", | ||
"description": "wechat 回复小工具 ,包括天气预报、历史今天、翻译工具 等实用功能", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -1,9 +0,13 @@ | ||
## wechat-tools 是微信公众平台开发者的实用小工具 | ||
## wechat-tools 让您的公众平台有可以回复‘天气预报’、‘历史上的今天’ 等 | ||
源码地址 [netpi/wechat-tools](https://github.com/netpi/wechat-tools) | ||
推荐微信公众平台的开发者配合使用 [node-webot/wechat](https://github.com/node-webot/wechat) | ||
## 安装 | ||
``` | ||
npm install wechat-tools -save; | ||
npm install wechat-tools --save; | ||
``` | ||
## 使用 | ||
### 1 回复天气预报 | ||
此为共享 ak = uD67wmZzhi3RFcmTkGoks2Dr,实际应用时建议去[百度开发者](developer.baidu.com/map/index.php)自行申请ak | ||
### 1 生成可以直接回复的‘天气预报’ | ||
此为共享 ak = uD67wmZzhi3RFcmTkGoks2Dr,实际应用时建议去[百度开发者](http://developer.baidu.com/map/index.php)自行申请ak | ||
@@ -23,4 +27,4 @@ ``` | ||
#### console.log(data); 结果如下图 | ||
![参考图片](http://netpi.github.io/resource/images/weather01.png) | ||
### 2 回复历史上的今天 | ||
![参考图片](http://pistatic.qiniudn.com/images/weather01.png?imageView2/1/w/500/) | ||
### 2 生成可以直接回复的‘历史上的今天’ | ||
``` | ||
@@ -36,2 +40,18 @@ wt.history(function (err,data) { | ||
#### console.log(data); 结果如下图 | ||
![参考图片](http://netpi.github.io/resource/images/history01.png) | ||
![参考图片](http://pistatic.qiniudn.com/images/history01.png?imageView2/1/w/400/) | ||
### 3 翻译小助手 | ||
``` | ||
var wt = request('wechat-tools'); | ||
var ak = 'uD67wmZzhi3RFcmTkGoks2Dr';// | ||
wt.translate(ak, '周末放假', function(err, data) { | ||
if (err) { | ||
throw err; | ||
} else { | ||
console.log(data);// --> The weekend holiday | ||
}; | ||
}); | ||
``` | ||
## 应用 | ||
![参考图片](http://pistatic.qiniudn.com/images/history-code.jpg?imageView2/1/w/300/) |
5557
9
111
55