Skip to content

Commit 85b6140

Browse files
committed
添加爱语飞飞,Ntfy,一封传话
1 parent f15d9c8 commit 85b6140

File tree

15 files changed

+1221
-3
lines changed

15 files changed

+1221
-3
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
- [RocketChat](https://docs.rocket.chat/guides/administration/admin-panel/integrations#incoming-webhook-script) -- RocketChat
3535
- [Gitter](https://developer.gitter.im/docs/messages-resource) -- Gitter
3636
- [Pushover](https://pushover.net/) -- Pushover
37+
- [爱语飞飞](https://iyuu.cn/) -- Iyuu
38+
- [Ntfy](https://docs.ntfy.sh/publish/) -- Ntfy
39+
- [一封传话](https://www.phprm.com/push/h5/) -- YiFengChuanHua
3740

3841
## 安装
3942

@@ -309,6 +312,22 @@ const { PushApi } = require('all-pusher-api'); // 多平台同时推送
309312
user: '******'
310313
}
311314
}
315+
},
316+
{
317+
name: 'Iyuu',
318+
config: {
319+
key: {
320+
token: '******'
321+
}
322+
}
323+
},
324+
{
325+
name: 'YiFengChuanHua',
326+
config: {
327+
key: {
328+
token: '******'
329+
}
330+
}
312331
}
313332
])
314333
.send({ message: '测试文本' })).map((e) => (e.result.status >= 200 && e.result.status < 300) ? `${e.name} 测试成功` : e));
@@ -587,6 +606,7 @@ const results: Array<{
587606
588607
- Showdoc: 'text'
589608
- Pushover: 'text'
609+
- 爱语飞飞: 'text'
590610
- QQ(go-cqhttp): 'text', 'other'
591611
- Qmsg: 'text', 'other'
592612
- Discord: 'text', 'other'
@@ -602,6 +622,7 @@ const results: Array<{
602622
- 企业微信群机器人: 'text', 'markdown', 'other'
603623
- 钉钉: 'text', 'markdown', 'other'
604624
- TelegramBot: 'text', 'markdown', 'html'
625+
- 一封传话: 'text', 'markdown', 'html'
605626
- 邮件: 'text', 'markdown*', 'html'
606627
- PushPlus: 'text', 'markdown*', 'html'
607628
- WxPusher: 'text', 'markdown*', 'html'

config/template.yaml.js

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,45 @@
381381
password:
382382
name: 代理密码
383383
type: text
384+
- name: 爱语飞飞
385+
type: json
386+
filename: copy
387+
quote: 爱语飞飞配置参数生成器
388+
author: HCLonely
389+
body:
390+
key:
391+
name: 认证信息
392+
type: object
393+
body:
394+
token:
395+
name: Token
396+
type: text
397+
desp: IYUU令牌
398+
required: true
399+
proxy:
400+
name: 代理设置(可选)
401+
type: object
402+
body:
403+
enable:
404+
name: 启用
405+
type: boolean
406+
defaultValue: false
407+
protocol:
408+
name: 代理协议
409+
type: text
410+
defaultValue: http
411+
host:
412+
name: 代理主机地址
413+
type: text
414+
port:
415+
name: 代理端口
416+
type: text
417+
username:
418+
name: 代理用户名
419+
type: text
420+
password:
421+
name: 代理密码
422+
type: text
384423
- name: Mail
385424
type: json
386425
filename: copy
@@ -453,6 +492,49 @@
453492
password:
454493
name: 代理密码
455494
type: text
495+
- name: Ntfy
496+
type: json
497+
filename: copy
498+
quote: Ntfy 配置参数生成器
499+
author: HCLonely
500+
body:
501+
key:
502+
name: 认证信息
503+
type: object
504+
body:
505+
token:
506+
name: Token
507+
desp: topic
508+
type: text
509+
required: true
510+
baseURL:
511+
name: baseURL
512+
desp: 如果使用自建服务端, 需配置此选项. baseURL为"mytopic"前面的部分.
513+
type: text
514+
proxy:
515+
name: 代理设置(可选)
516+
type: object
517+
body:
518+
enable:
519+
name: 启用
520+
type: boolean
521+
defaultValue: false
522+
protocol:
523+
name: 代理协议
524+
type: text
525+
defaultValue: http
526+
host:
527+
name: 代理主机地址
528+
type: text
529+
port:
530+
name: 代理端口
531+
type: text
532+
username:
533+
name: 代理用户名
534+
type: text
535+
password:
536+
name: 代理密码
537+
type: text
456538
- name: Push
457539
type: json
458540
filename: copy
@@ -1067,6 +1149,45 @@
10671149
password:
10681150
name: 代理密码
10691151
type: text
1152+
- name: 一封传话
1153+
type: json
1154+
filename: copy
1155+
quote: 一封传话配置参数生成器
1156+
author: HCLonely
1157+
body:
1158+
key:
1159+
name: 认证信息
1160+
type: object
1161+
body:
1162+
token:
1163+
name: Token
1164+
desp: API口令码
1165+
type: text
1166+
required: true
1167+
proxy:
1168+
name: 代理设置(可选)
1169+
type: object
1170+
body:
1171+
enable:
1172+
name: 启用
1173+
type: boolean
1174+
defaultValue: false
1175+
protocol:
1176+
name: 代理协议
1177+
type: text
1178+
defaultValue: http
1179+
host:
1180+
name: 代理主机地址
1181+
type: text
1182+
port:
1183+
name: 代理端口
1184+
type: text
1185+
username:
1186+
name: 代理用户名
1187+
type: text
1188+
password:
1189+
name: 代理密码
1190+
type: text
10701191
- name: Zulip
10711192
type: json
10721193
filename: copy

dist/Iyuu.js

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
'use strict';
2+
3+
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
4+
5+
Object.defineProperty(exports, '__esModule', {
6+
value: true
7+
});
8+
9+
var axios = require('axios');
10+
11+
var tool = require('./tool');
12+
13+
function _interopDefaultLegacy(e) {
14+
return e && typeof e === 'object' && 'default' in e ? e : {
15+
'default': e
16+
};
17+
}
18+
19+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
20+
21+
class Iyuu {
22+
constructor({
23+
token,
24+
key,
25+
proxy
26+
}) {
27+
_defineProperty(this, "_KEY", void 0);
28+
29+
_defineProperty(this, "baseURL", 'https://iyuu.cn/');
30+
31+
_defineProperty(this, "httpsAgent", void 0);
32+
33+
const $key = {
34+
token,
35+
...key
36+
};
37+
38+
if (!$key.token) {
39+
throw new Error('Missing Parameter: token');
40+
}
41+
42+
this._KEY = $key.token;
43+
44+
if (proxy && proxy.enable) {
45+
this.httpsAgent = tool.proxy2httpsAgent(proxy);
46+
}
47+
}
48+
49+
async send(sendOptions) {
50+
if (!sendOptions.message && !sendOptions.customOptions) {
51+
return {
52+
status: 0,
53+
statusText: 'Missing Parameter: message',
54+
extraMessage: null
55+
};
56+
}
57+
58+
let iyuuOptions;
59+
60+
if (sendOptions.customOptions) {
61+
iyuuOptions = sendOptions.customOptions;
62+
} else {
63+
iyuuOptions = {
64+
text: sendOptions.title || sendOptions.message.split('\n')[0].trim().slice(0, 10),
65+
desp: sendOptions.message
66+
};
67+
}
68+
69+
if (sendOptions.extraOptions) {
70+
iyuuOptions = { ...iyuuOptions,
71+
...sendOptions.extraOptions
72+
};
73+
}
74+
75+
const axiosOptions = {
76+
url: `${this.baseURL}${this._KEY}.send`,
77+
method: 'POST',
78+
headers: {
79+
'Content-type': 'application/x-www-form-urlencoded'
80+
},
81+
data: tool.queryStringify(iyuuOptions)
82+
};
83+
84+
if (this.httpsAgent) {
85+
axiosOptions.httpsAgent = this.httpsAgent;
86+
}
87+
88+
return axios__default["default"](axiosOptions).then(response => {
89+
if (response.data) {
90+
if (response.data.errcode === 0) {
91+
return {
92+
status: 200,
93+
statusText: 'Success',
94+
extraMessage: response
95+
};
96+
}
97+
98+
return {
99+
status: 100,
100+
statusText: 'Error',
101+
extraMessage: response
102+
};
103+
}
104+
105+
return {
106+
status: 101,
107+
statusText: 'No Response Data',
108+
extraMessage: response
109+
};
110+
}).catch(error => ({
111+
status: 102,
112+
statusText: 'Request Error',
113+
extraMessage: error
114+
}));
115+
}
116+
117+
}
118+
119+
exports.Iyuu = Iyuu;

0 commit comments

Comments
 (0)