Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import hypeauditor from "../../hypeauditor.app.mjs";

export default {
key: "hypeauditor-get-tiktok-report",
name: "Get TikTok Report",
description: "Generates a comprehensive TikTok report for a specified channel. [See the documentation](https://hypeauditor.readme.io/reference/report_tiktok)",
version: "0.0.1",
type: "action",
props: {
hypeauditor,
channel: {
propDefinition: [
hypeauditor,
"tiktokChannel",
],
},
},
async run({ $ }) {
const {
hypeauditor, ...params
} = this;
const response = await hypeauditor.getTikTokReport({
$,
params,
});
$.export("$summary", `Successfully fetched TikTok report for channel ${this.channel}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import hypeauditor from "../../hypeauditor.app.mjs";

export default {
key: "hypeauditor-get-twitch-report",
name: "Get Twitch Report",
description: "Generates a Twitch report for a specified channel. [See the documentation](https://hypeauditor.readme.io/reference/report_twitch)",
version: "0.0.1",
type: "action",
props: {
hypeauditor,
channel: {
propDefinition: [
hypeauditor,
"twitchChannel",
],
},
},
async run({ $ }) {
const {
hypeauditor, ...params
} = this;
const response = await hypeauditor.getTwitchReport({
$,
params,
});
$.export("$summary", `Successfully fetched Twitch report for channel ${this.channel}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import hypeauditor from "../../hypeauditor.app.mjs";

export default {
key: "hypeauditor-get-youtube-report",
name: "Get YouTube Report",
description: "Generates a comprehensive YouTube report for a specified channel. [See the documentation](https://hypeauditor.readme.io/reference/report_youtube)",
version: "0.0.1",
type: "action",
props: {
hypeauditor,
channel: {
propDefinition: [
hypeauditor,
"youtubeChannel",
],
},
features: {
propDefinition: [
hypeauditor,
"youtubeFeatures",
],
},
},
async run({ $ }) {
const {
hypeauditor, ...params
} = this;
const response = await hypeauditor.getYouTubeReport({
$,
params,
});
$.export("$summary", `Successfully fetched YouTube report for channel ${this.channel}`);
return response;
},
};
62 changes: 58 additions & 4 deletions components/hypeauditor/hypeauditor.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,65 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "hypeauditor",
propDefinitions: {},
propDefinitions: {
youtubeChannel: {
type: "string",
label: "Channel ID or Username",
description: "The YouTube channel ID or username for which to generate a report.",
},
youtubeFeatures: {
type: "string",
label: "Features List",
description: "Optional list of features to include in the YouTube report. [See the documentation](https://hypeauditor.readme.io/reference/report_youtube) for more information.",
optional: true,
},
tiktokChannel: {
type: "string",
label: "TikTok Channel Username",
description: "The TikTok username (e.g. `littlebig`) from a TikTok channel URL (in this example, `https://www.tiktok.com/@littlebig`).",
},
twitchChannel: {
type: "string",
label: "Twitch Channel Username",
description: "The Twitch username (e.g. `nasa`) from a Twitch channel URL (in this example, `https://www.twitch.tv/nasa`).",
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://hypeauditor.com/api/method";
},
async _makeRequest({
$ = this, path, headers, ...otherOpts
} = {}) {
return axios($, {
url: `${this._baseUrl()}${path}`,
headers: {
...headers,
"x-auth-token": this.$auth.token,
"x-auth-id": this.$auth.id,
},
...otherOpts,
});
},
async getYouTubeReport(opts = {}) {
return this._makeRequest({
path: "/auditor.youtube/",
...opts,
});
},
async getTikTokReport(opts = {}) {
return this._makeRequest({
path: "/auditor.tiktok/",
...opts,
});
},
async getTwitchReport(opts = {}) {
return this._makeRequest({
path: "/auditor.twitch/",
...opts,
});
},
},
};
7 changes: 5 additions & 2 deletions components/hypeauditor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/hypeauditor",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream HypeAuditor Components",
"main": "hypeauditor.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
}
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading