Skip to content

Commit db6dade

Browse files
committed
new components
1 parent 7b1b976 commit db6dade

File tree

5 files changed

+397
-6
lines changed

5 files changed

+397
-6
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import zenserp from "../../zenserp.app.mjs";
2+
3+
export default {
4+
key: "zenserp-google-image-search",
5+
name: "Google Image Search",
6+
description: "Perform a Google image search using the Zenserp API. [See the documentation](https://app.zenserp.com/documentation#imageSearch)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
zenserp,
16+
q: {
17+
propDefinition: [
18+
zenserp,
19+
"q",
20+
],
21+
},
22+
searchEngine: {
23+
propDefinition: [
24+
zenserp,
25+
"searchEngine",
26+
],
27+
},
28+
country: {
29+
propDefinition: [
30+
zenserp,
31+
"country",
32+
],
33+
},
34+
language: {
35+
propDefinition: [
36+
zenserp,
37+
"language",
38+
],
39+
},
40+
num: {
41+
propDefinition: [
42+
zenserp,
43+
"num",
44+
],
45+
},
46+
start: {
47+
propDefinition: [
48+
zenserp,
49+
"start",
50+
],
51+
},
52+
device: {
53+
propDefinition: [
54+
zenserp,
55+
"device",
56+
],
57+
},
58+
timeframe: {
59+
propDefinition: [
60+
zenserp,
61+
"timeframe",
62+
],
63+
},
64+
},
65+
async run({ $ }) {
66+
const response = await this.zenserp.search({
67+
$,
68+
params: {
69+
q: this.q,
70+
tbm: "isch",
71+
search_engine: this.searchEngine,
72+
gl: this.country,
73+
lr: this.language,
74+
num: this.num,
75+
start: this.start,
76+
device: this.device,
77+
timeframe: this.timeframe,
78+
},
79+
});
80+
$.export("$summary", `Successfully searched for images with query "${this.q}"`);
81+
return response;
82+
},
83+
};
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import zenserp from "../../zenserp.app.mjs";
2+
3+
export default {
4+
key: "zenserp-google-news-search",
5+
name: "Google News Search",
6+
description: "Perform a Google news search using the Zenserp API. [See the documentation](https://app.zenserp.com/documentation#newsSearch)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
zenserp,
16+
q: {
17+
propDefinition: [
18+
zenserp,
19+
"q",
20+
],
21+
},
22+
searchEngine: {
23+
propDefinition: [
24+
zenserp,
25+
"searchEngine",
26+
],
27+
},
28+
country: {
29+
propDefinition: [
30+
zenserp,
31+
"country",
32+
],
33+
},
34+
language: {
35+
propDefinition: [
36+
zenserp,
37+
"language",
38+
],
39+
},
40+
num: {
41+
propDefinition: [
42+
zenserp,
43+
"num",
44+
],
45+
},
46+
start: {
47+
propDefinition: [
48+
zenserp,
49+
"start",
50+
],
51+
},
52+
device: {
53+
propDefinition: [
54+
zenserp,
55+
"device",
56+
],
57+
},
58+
timeframe: {
59+
propDefinition: [
60+
zenserp,
61+
"timeframe",
62+
],
63+
},
64+
},
65+
async run({ $ }) {
66+
const response = await this.zenserp.search({
67+
$,
68+
params: {
69+
q: this.q,
70+
tbm: "nws",
71+
search_engine: this.searchEngine,
72+
gl: this.country,
73+
lr: this.language,
74+
num: this.num,
75+
start: this.start,
76+
device: this.device,
77+
timeframe: this.timeframe,
78+
},
79+
});
80+
$.export("$summary", `Successfully searched for news with query "${this.q}"`);
81+
return response;
82+
},
83+
};
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import zenserp from "../../zenserp.app.mjs";
2+
3+
export default {
4+
key: "zenserp-google-search",
5+
name: "Google Search",
6+
description: "Perform a Google search using the Zenserp API. [See the documentation](https://app.zenserp.com/documentation#search)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
zenserp,
16+
q: {
17+
propDefinition: [
18+
zenserp,
19+
"q",
20+
],
21+
},
22+
searchEngine: {
23+
propDefinition: [
24+
zenserp,
25+
"searchEngine",
26+
],
27+
},
28+
country: {
29+
propDefinition: [
30+
zenserp,
31+
"country",
32+
],
33+
},
34+
language: {
35+
propDefinition: [
36+
zenserp,
37+
"language",
38+
],
39+
},
40+
num: {
41+
propDefinition: [
42+
zenserp,
43+
"num",
44+
],
45+
},
46+
start: {
47+
propDefinition: [
48+
zenserp,
49+
"start",
50+
],
51+
},
52+
device: {
53+
propDefinition: [
54+
zenserp,
55+
"device",
56+
],
57+
},
58+
timeframe: {
59+
propDefinition: [
60+
zenserp,
61+
"timeframe",
62+
],
63+
},
64+
},
65+
async run({ $ }) {
66+
const response = await this.zenserp.search({
67+
$,
68+
params: {
69+
q: this.q,
70+
search_engine: this.searchEngine,
71+
gl: this.country,
72+
lr: this.language,
73+
num: this.num,
74+
start: this.start,
75+
device: this.device,
76+
timeframe: this.timeframe,
77+
},
78+
});
79+
$.export("$summary", `Successfully searched "${this.q}"`);
80+
return response;
81+
},
82+
};

components/zenserp/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/zenserp",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Zenserp Components",
55
"main": "zenserp.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.1.0"
1417
}
1518
}

0 commit comments

Comments
 (0)