npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yixin

v1.0.3

Published

易信公众平台API

Downloads

6

Readme

node-yixin

易信公众帐号api,参考wechat

功能列表

  • 接收用户发送信息(文本,图片,语音,视频,音乐,地理位置,事件消息)
  • 自动回复(文本,图片,音乐,图文)
  • 客服消息(文本,图片,语音,视频,链接,名片,图文消息)
  • 群组消息(文本,图文,名片)
  • 菜单操作(查询、创建、删除)
  • 二维码(创建临时、永久二维码,查看二维码URL)
  • 分组操作(查询、创建、修改、移动用户到分组)
  • 用户信息(查询用户基本信息、获取关注者列表)
  • OAuth API(授权、获取基本信息)
  • 媒体文件(上传、获取)

Install

npm install yixin

Use with Connect/Express

//...
var Yixin = require('./');
var yixin = new Yixin('token');
app.configure(function() {
  app.use(express.query());
  app.use('/yinxin', yixin.middleware);
  yixin
    .text(function(req, res) {
      var message = req.yixin; //用户的消息通过`req.yixin`获取
      res.reply('hello world');
    })
    .image(function(req, res) {
      //...
    });
  //...
});


//...

回复消息

当用户发送消息到微信公众账号,自动回复一条消息。这条消息可以是文本、图片、音乐、图文。详见:官方文档

回复文本

res.reply('Hello world!');
// 或者
res.reply({type: "text", content: 'Hello world!'});

回复图片

res.reply({
  type: "image",
  content: {
    mediaId: 'mediaId'
  }
});

回复音乐

res.reply({
  description: "一无所有",
  musicUrl: "http://mp3.com/xx.mp3",
  hqMusicUrl: "http://mp3.com/xx.mp3"
});

回复图文

res.reply([
  {
    title: '你来我家接我吧',
    description: '这是女神与高富帅之间的对话',
    picurl: 'http://nodeapi.cloudfoundry.com/qrcode.jpg',
    url: 'http://nodeapi.cloudfoundry.com/'
  }
]);