Skip to content

Commit eabacb0

Browse files
committed
Twitch report action
1 parent f8ceec8 commit eabacb0

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import hypeauditor from "../../hypeauditor.app.mjs";
2+
3+
export default {
4+
key: "hypeauditor-get-twitch-report",
5+
name: "Get Twitch Report",
6+
description: "Generates a Twitch report for a specified channel. [See the documentation](https://hypeauditor.readme.io/reference/report_twitch)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hypeauditor,
11+
channel: {
12+
propDefinition: [
13+
hypeauditor,
14+
"twitchChannel",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const {
20+
hypeauditor, ...params
21+
} = this;
22+
const response = await hypeauditor.getTwitchReport({
23+
$,
24+
params,
25+
});
26+
$.export("$summary", `Successfully fetched Twitch report for channel ${this.channel}`);
27+
return response;
28+
},
29+
};

components/hypeauditor/hypeauditor.app.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export default {
1818
tiktokChannel: {
1919
type: "string",
2020
label: "TikTok Channel Username",
21-
description: "A TikTok username (e.g. `littlebig`) from the TikTok channel URL (in this example, `https://www.tiktok.com/@littlebig`).",
21+
description: "The TikTok username (e.g. `littlebig`) from a TikTok channel URL (in this example, `https://www.tiktok.com/@littlebig`).",
2222
},
2323
twitchChannel: {
2424
type: "string",
2525
label: "Twitch Channel Username",
26-
description: "The Twitch channel username for which to generate a report.",
26+
description: "The Twitch username (e.g. `nasa`) from a Twitch channel URL (in this example, `https://www.twitch.tv/nasa`).",
2727
},
2828
},
2929
methods: {

0 commit comments

Comments
 (0)