
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
hapi-wechat
Advanced tools
Wechat plugin for hapi
version: 3.8.1
https://github.com/node-webot/co-wechat-api
http://doxmate.cool/node-webot/co-wechat-api/api.html
npm install github:dhso/hapi-wechat
routerPath: '/wechat, required'
handlerPath: 'wechat/*.js', required'
appid: 'your appid, required',
appsecret: 'your appsecret, required'
token: 'your token, required'
encodingAESKey: 'your encodingAESKey, optional'
['text', 'image', 'voice', 'video', 'location', 'link', 'subscribe', 'unsubscribe', 'click']
// /wechat/text.js
module.exports = async (inMsg, req, h) => {
try {
// wechat api send message
let res = await h.wechat_api.sendText(inMsg.fromUsername, 'Hello world');
console.log(res);
// send common message
return {
content: inMsg.content
}
} catch (err) {
// send error message
return {
content: err.message
}
}
};
// /wechat/subscribe.js
module.exports = (inMsg, req, h) => {
return {
msgType: 'news',
content: [
{
title: "欢迎关注ThinkApp",
description: "这是本人测试用的订阅公众号,欢迎访问我的Oschina Git。",
url: "https://gitee.com/dhso"
}
]
}
};
module.exports = async (inMsg, req, h) => {
try {
let reply, tuling = await h.axios.post('http://www.tuling123.com/openapi/api', {
"key": "your key",
"userid": inMsg.fromUsername,
"info": inMsg.content
});
switch (tuling.data.code) {
case 100000:
reply = { 'content': tuling.data.text };
break;
case 200000:
reply = {
'msgType': 'news',
'content': [{
'title': tuling.data.text,
'description': '请点击跳转到结果页面。',
'url': tuling.data.url
}]
}
break;
case 302000:
reply = {
'msgType': 'news',
'content': []
}
for (var item of tuling.data.list) {
if (reply.content.length >= 8) break;
reply.content.push({
'title': item.article,
'description': item.source,
'picurl': item.icon.indexOf('//') == 0 ? 'http:' + item.icon : item.icon,
'url': item.detailurl
});
}
break;
case 308000:
reply = {
'msgType': 'news',
'content': []
}
for (var item of tuling.data.list) {
if (reply.content.length >= 8) break;
reply.content.push({
'title': item.name,
'description': item.info,
'picurl': item.icon.indexOf('//') == 0 ? 'http:' + item.icon : item.icon,
'url': item.detailurl
});
}
break;
}
return reply;
} catch (err) {
return {
content: err.message
}
}
};
FAQs
wechat api for hapi
We found that hapi-wechat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.