WeeChat Notify-Send 项目使用教程

WeeChat Notify-Send 项目使用教程

weechat-notify-sendA WeeChat script that sends highlight and message notifications through notify-send.项目地址:https://gitcode.com/gh_mirrors/we/weechat-notify-send

1. 项目的目录结构及介绍

WeeChat Notify-Send 项目的目录结构如下:

weechat-notify-send/
├── CHANGELOG.md
├── LICENSE
├── Makefile
├── README.md
├── coveragerc
├── gitignore
├── notify_send.py
├── notify_send_tests.py
└── screenshot.png

目录结构介绍

  • CHANGELOG.md: 记录项目的更新日志。
  • LICENSE: 项目的许可证文件,本项目使用 MIT 许可证。
  • Makefile: 用于自动化构建和测试的 Makefile 文件。
  • README.md: 项目的主文档,包含项目的基本信息和使用说明。
  • coveragerc: 用于代码覆盖率测试的配置文件。
  • gitignore: Git 版本控制系统的忽略文件配置。
  • notify_send.py: 项目的主脚本文件,用于发送通知。
  • notify_send_tests.py: 项目的测试脚本文件,用于自动化测试。
  • screenshot.png: 项目的截图文件,展示通知的效果。

2. 项目的启动文件介绍

项目的启动文件是 notify_send.py。该文件是 WeeChat 的一个脚本,用于发送高亮和消息通知。

启动文件介绍

  • notify_send.py: 该脚本通过 notify-send 命令发送通知。它需要 libnotify 库,该库提供了 notify-send 应用程序。脚本的具体外观取决于您的通知系统的配置以及使用的图标。

3. 项目的配置文件介绍

项目的配置文件主要是 notify_send.py 脚本中的配置选项。您可以通过以下方式设置这些选项:

配置文件介绍

  • 通过运行 /set plugins.var.python.notify_send.XXX YYY 命令来设置选项。
  • 通过使用 iset.pl 脚本来设置选项。

配置选项

  • notify_on_highlights: 发送高亮通知。默认值为 on

这些选项可以在 WeeChat 的设置界面中进行配置,也可以通过命令行直接设置。


以上是 WeeChat Notify-Send 项目的使用教程,包含了项目的目录结构、启动文件和配置文件的介绍。希望对您有所帮助!

weechat-notify-sendA WeeChat script that sends highlight and message notifications through notify-send.项目地址:https://gitcode.com/gh_mirrors/we/weechat-notify-send

  • 19
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是一个使用 Node.js 和 Express 框架对接微信支付的示例代码: ``` const express = require('express') const app = express() const bodyParser = require('body-parser') const xmlparser = require('express-xml-bodyparser') const { payment } = require('wechat-pay') const config = { appid: 'your app id', mchid: 'your merchant id', partnerKey: 'your partner key', pfx: require('fs').readFileSync('path/to/your/apiclient_cert.p12'), } const wxPay = payment(config) app.use(bodyParser.urlencoded({ extended: false })) app.use(xmlparser()) app.post('/pay', async (req, res) => { const { body } = req // 构造订单参数 const order = { body: '商品名称', out_trade_no: '订单号', total_fee: 1, // 订单总金额,单位为分 spbill_create_ip: '用户IP地址', notify_url: '支付结果通知地址', trade_type: 'JSAPI', // 交易类型 openid: '用户的openid', } try { const result = await wxPay.createOrder(order) const { prepay_id, ...rest } = result const payArgs = { appId: config.appid, timeStamp: (Date.now() / 1000).toFixed(0), nonceStr: Math.random().toString(36).substr(2), package: `prepay_id=${prepay_id}`, signType: 'MD5', } const paySign = wxPay.sign(payArgs) const response = { ...payArgs, paySign, ...rest, } res.send(response) } catch (err) { console.error(err) res.status(500).send(err.message) } }) app.listen(3000, () => { console.log('App listening on port 3000') }) ``` 这段代码使用了 `wechat-pay` 模块来对接微信支付,该模块提供了方便的 API 来创建订单、查询订单等操作。需要注意的是,该模块需要使用商户证书进行签名和加密,因此需要将商户证书的路径和密码等配置信息传入到 `payment` 函数中。在具体使用时,需要将示例代码中的 `your app id`、`your merchant id`、`your partner key` 等参数替换为真实的值。同时,需要在微信公众平台上设置支付通知回调地址,并将该地址填写到订单参数中的 `notify_url` 字段中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

秋玥多

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值