Skip to content

Commit 3adb077

Browse files
committed
Package and app file updates
1 parent 20fef2e commit 3adb077

File tree

2 files changed

+11
-26
lines changed

2 files changed

+11
-26
lines changed

components/spider/package.json

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

components/spider/spider.app.mjs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,16 @@ import { axios } from "@pipedream/platform";
33
export default {
44
type: "app",
55
app: "spider",
6-
propDefinitions: {
7-
url: {
8-
type: "string",
9-
label: "URL to Scrape",
10-
description: "The URL of the page to scrape.",
11-
},
12-
},
6+
propDefinitions: {},
137
methods: {
14-
// this.$auth contains connected account data
15-
authKeys() {
16-
console.log(Object.keys(this.$auth));
17-
},
188
_baseUrl() {
199
return "https://api.spider.cloud";
2010
},
21-
async _makeRequest(opts = {}) {
22-
const {
23-
$ = this, method = "GET", path = "/", headers, ...otherOpts
24-
} = opts;
11+
async _makeRequest({
12+
$ = this, path = "/", headers, ...otherOpts
13+
} = {}) {
2514
return axios($, {
2615
...otherOpts,
27-
method,
2816
url: this._baseUrl() + path,
2917
headers: {
3018
...headers,
@@ -33,18 +21,12 @@ export default {
3321
},
3422
});
3523
},
36-
async initiateCrawl() {
37-
const response = await this._makeRequest({
24+
async initiateCrawl(args) {
25+
return this._makeRequest({
3826
method: "POST",
3927
path: "/crawl",
40-
data: {
41-
url: this.url,
42-
},
28+
...args,
4329
});
44-
if (Array.isArray(response) && response.length > 0) {
45-
return response[0].content;
46-
}
47-
throw new Error("No content returned from crawl");
4830
},
4931
},
5032
};

0 commit comments

Comments
 (0)