Socket
Socket
Sign inDemoInstall

wechat-tools

Package Overview
Dependencies
8
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wechat-tools

wechat 回复小工具 ,包括天气预报、历史今天、翻译工具 等实用功能


Version published
Weekly downloads
3
Maintainers
1
Install size
177 kB
Created
Weekly downloads
 

Readme

Source

wechat-tools 让您的公众平台有可以回复‘天气预报’、‘历史上的今天’ 等

源码地址 netpi/wechat-tools

推荐微信公众平台的开发者配合使用 node-webot/wechat

安装

npm install wechat-tools --save;

1 生成可以直接回复的‘天气预报’

此为共享 ak = uD67wmZzhi3RFcmTkGoks2Dr,实际应用时建议去百度开发者自行申请ak

var wt = request('wechat-tools');
var ak = 'uD67wmZzhi3RFcmTkGoks2Dr';//
var city = '北京';
wt.weather(ak,city,function(err , data){
    if(err){
      throw err;
    }else{
     console.log(data);
   }
});
console.log(data); 结果如下图

参考图片

2 生成可以直接回复的‘历史上的今天’

wt.history(function (err,data) {
    if(err){
      throw err;
    }else{
      console.log(data);
    }
  })
console.log(data); 结果如下图

参考图片

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
    };
  });

应用

参考图片

Keywords

FAQs

Last updated on 16 Oct 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc