Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import adyntel from "../../adyntel.app.mjs";

export default {
key: "adyntel-google-ads-by-company",
name: "Get Google Ads by Company",
description: "Retrieve all Google ads for a given company domain. [See the documentation](https://docs.adyntel.com/ad-libraries/google)",
version: "0.0.1",
type: "action",
props: {
adyntel,
companyDomain: {
type: "string",
label: "Company Domain",
description: "The company domain. Company domain has to be passed in the 'company.com' format, meaning all prefixes like 'https://' or 'www.' need to be removed.",
},
mediaType: {
type: "string",
label: "Media Type",
description: "Filter results based on media type",
options: [
"text",
"image",
"video",
],
optional: true,
},
},
async run({ $ }) {
const response = await this.adyntel.getGoogleAds({
$,
data: {
company_domain: this.companyDomain,
media_type: this.mediaType,
},
});
$.export("$summary", `Fetched Google Ads for domain ${this.companyDomain}`);
return response;
},
};
37 changes: 37 additions & 0 deletions components/adyntel/actions/meta-ad-search/meta-ad-search.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import adyntel from "../../adyntel.app.mjs";

export default {
key: "adyntel-meta-ad-search",
name: "Meta Ad Search",
description: "Searches the Meta ad library. [See the documentation](https://docs.adyntel.com/ad-libraries/meta-ad-search)",
version: "0.0.1",
type: "action",
props: {
adyntel,
keyword: {
propDefinition: [
adyntel,
"keyword",
],
},
countryCode: {
propDefinition: [
adyntel,
"countryCode",
],
},
},
async run({ $ }) {
const response = await this.adyntel.metaAdSearch({
$,
data: {
keyword: this.keyword,
country_code: this.countryCode,
},
});
$.export("$summary", `Successfully performed Meta ad search with keyword: \`${this.keyword}\`${this.countryCode
? ` and country code: \`${this.countryCode}\``
: ""}`);
return response;
},
};
28 changes: 28 additions & 0 deletions components/adyntel/actions/tiktok-search/tiktok-search.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import adyntel from "../../adyntel.app.mjs";

export default {
key: "adyntel-tiktok-search",
name: "Search TikTok Ads",
description: "Search TikTok ads using a keyword. [See the documentation](https://docs.adyntel.com/ad-libraries/tiktok-search)",
version: "0.0.1",
type: "action",
props: {
adyntel,
keyword: {
propDefinition: [
adyntel,
"keyword",
],
},
},
async run({ $ }) {
const response = await this.adyntel.getTiktokAds({
$,
data: {
keyword: this.keyword,
},
});
$.export("$summary", `Successfully retrieved TikTok ads for keyword: \`${this.keyword}\``);
return response;
},
};
59 changes: 54 additions & 5 deletions components/adyntel/adyntel.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,60 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "adyntel",
propDefinitions: {},
propDefinitions: {
keyword: {
type: "string",
label: "Keyword",
description: "The keyword to search by",
},
countryCode: {
type: "string",
label: "Country Code",
description: "Use if you want to limit the search to only one country. E.g. `US`",
optional: true,
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.adyntel.com";
},
_makeRequest({
$ = this,
method = "POST",
path = "/",
data = {},
...otherOpts
}) {
return axios($, {
...otherOpts,
method,
url: `${this._baseUrl()}${path}`,
data: {
...data,
api_key: this.$auth.api_key,
email: this.$auth.username,
},
});
},
metaAdSearch(opts = {}) {
return this._makeRequest({
path: "/facebook_ad_search",
...opts,
});
},
getGoogleAds(opts = {}) {
return this._makeRequest({
path: "/google",
...opts,
});
},
getTiktokAds(opts = {}) {
return this._makeRequest({
path: "/tiktok_search",
...opts,
});
},
},
};
};
7 changes: 5 additions & 2 deletions components/adyntel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/adyntel",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Adyntel Components",
"main": "adyntel.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"
}
}
}
25 changes: 14 additions & 11 deletions pnpm-lock.yaml

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

Loading