Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

添加爱语飞飞app #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions apps/iyuu/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"identification": "w5soar",
"is_public": true,
"name": "爱语飞飞",
"version": "0.1",
"description": "爱语飞飞微信通知",
"type": "消息通知",
"action": [
{
"name": "微信通知",
"func": "send"
}
],
"args": {
"send": [
{
"key": "key",
"type": "text",
"required": true
},
{
"key": "text",
"type": "text",
"required": true
},
{
"key": "desp",
"type": "textarea",
"required": false
}
]
}
}
Binary file added apps/iyuu/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added apps/iyuu/main/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions apps/iyuu/main/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
# encoding:utf-8
# cython: language_level=3
from loguru import logger
import requests


async def send(key, text, desp):
logger.info("[爱语飞飞] APP执行参数为: {key} {text} {desp}", key=key, text=text, desp=desp)

try:
url = "https://iyuu.cn/{0}.send?desp={1}&text={2}".format(key, desp, text)

r = requests.get(url=url,verify=False)
print(r.json())
except Exception as e:
logger.error("[爱语飞飞] 请求 API 失败:{e}", e=e)
return {"status": 2, "result": "请求 爱语飞飞 API 失败"}

return {"status": 0, "result": r.json()}
23 changes: 23 additions & 0 deletions apps/iyuu/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## APP 说明


- 官方文档:https://iyuu.cn/

## 动作列表

### 微信通知

**参数:**

| 参数 | 类型 | 必填 | 备注 |
| ---- | ---- | ---- |----------------|
| **key** | text | `是` | 点击开始使用后,扫码获取令牌 |
| **text** | text | `是` | 通知标题 |
| **desp** | text | `否` | 通知内容 |

**返回值:**

```
# 正常
{'errcode': 0, 'errmsg': 'ok', 'data': []}
```