Untitled 9 avatar
Untitled 9

Pricing

Pay per usage

Go to Store
Untitled 9

Untitled 9

Developed by

Marek Trunkát

Marek Trunkát

Maintained by Community

0.0 (0)

Pricing

Pay per usage

1

Total users

1

Monthly users

1

Runs succeeded

>99%

Last modified

6 years ago

Dockerfile

FROM apify/actor-node-basic
# Copy source code
COPY . ./
#COPY src ./src
RUN npm --quiet set progress=false \
&& npm install --only=prod --no-optional \
&& echo "Installed NPM packages:" \
&& npm list \
&& echo "Node.js version:" \
&& node --version \
&& echo "NPM version:" \
&& npm --version

INPUT_SCHEMA.json

{
"title": "Google search scraper input",
"description": "Define the Google search query using parameters below. You can scrape the data using specific language, country and location UUID.",
"type": "object",
"schemaVersion": 1,
"properties": {
"email": {
"title": "Email",
"type": "string",
"description": "Email where the notification about test failture gets send.",
"editor": "textfield",
"default": "By default the notification gets send to an email connected with your account."
},
"actorId": {
"title": "Actor ID",
"type": "string",
"description": "ID of an actor you want to test.",
"editor": "textfield"
},
"memory": {
"title": "Memory",
"type": "string",
"description": "Select memory for actor you want to test.",
"editor": "select",
"default": "1024",
"enum": ["128", "256", "512", "1024", "2048", "4096", "8192", "16384"],
"enumTitles": ["128 MB", "256 MB", "512 MB", "1024 MB", "2048 MB", "4096 MB", "8192 MB", "16384 MB"]
},
"build": {
"title": "Build",
"type": "string",
"description": "Actor build tag or version to test.",
"editor": "textfield",
"default": "latest"
},
"timeout": {
"title": "Timeout",
"type": "integer",
"unit": "seconds",
"description": "Timeout for actor you want to test.",
"default": 300,
"minimum": 1
},
"input": {
"title": "Input",
"type": "object",
"description": "Input for an actor you are testing.",
"prefill": { "foo": "bar" },
"editor": "json"
},
"testFunction": {
"title": "Test function",
"type": "string",
"description": "Custom function to test the finished run of the actor.",
"editor": "javascript",
"prefill": "async ({ input, $, request, response, html }) => {\n return {\n pageTitle: $('title').text(),\n };\n};"
}
},
"required": []
}

main.js

1const Apify = require('apify');
2const request = require('request-promise');
3
4Apify.main(async () => {
5 // Get input of your actor
6 const input = await Apify.getValue('INPUT');
7 console.log('My input:');
8 console.dir(input);
9
10 // Do something useful here
11 const html = await request('http://www.example.com');
12
13 // And then save output
14 const output = {
15 html,
16 crawledAt: new Date(),
17 };
18 console.log('My output:');
19 console.dir(output);
20 await Apify.setValue('OUTPUT', output);
21});

package.json

{
"name": "actors-name",
"version": "0.0.1",
"description": "Actors description",
"main": "main.js",
"dependencies": {
"apify": "^0.11.5",
"request-promise": "^4.2.2"
},
"scripts": {
"start": "node main.js"
},
"author": "Actor creators name"
}