Untitled 9
Try for free
No credit card required
Go to Store
Untitled 9
mtrunkat.com/untitled-9
Try for free
No credit card required
Dockerfile
1FROM apify/actor-node-basic
2# Copy source code
3COPY . ./
4#COPY src ./src
5RUN npm --quiet set progress=false \
6&& npm install --only=prod --no-optional \
7&& echo "Installed NPM packages:" \
8&& npm list \
9&& echo "Node.js version:" \
10&& node --version \
11&& echo "NPM version:" \
12&& npm --version
INPUT_SCHEMA.json
1{
2 "title": "Google search scraper input",
3 "description": "Define the Google search query using parameters below. You can scrape the data using specific language, country and location UUID.",
4 "type": "object",
5 "schemaVersion": 1,
6 "properties": {
7 "email": {
8 "title": "Email",
9 "type": "string",
10 "description": "Email where the notification about test failture gets send.",
11 "editor": "textfield",
12 "default": "By default the notification gets send to an email connected with your account."
13 },
14 "actorId": {
15 "title": "Actor ID",
16 "type": "string",
17 "description": "ID of an actor you want to test.",
18 "editor": "textfield"
19 },
20 "memory": {
21 "title": "Memory",
22 "type": "string",
23 "description": "Select memory for actor you want to test.",
24 "editor": "select",
25 "default": "1024",
26 "enum": ["128", "256", "512", "1024", "2048", "4096", "8192", "16384"],
27 "enumTitles": ["128 MB", "256 MB", "512 MB", "1024 MB", "2048 MB", "4096 MB", "8192 MB", "16384 MB"]
28 },
29 "build": {
30 "title": "Build",
31 "type": "string",
32 "description": "Actor build tag or version to test.",
33 "editor": "textfield",
34 "default": "latest"
35 },
36 "timeout": {
37 "title": "Timeout",
38 "type": "integer",
39 "unit": "seconds",
40 "description": "Timeout for actor you want to test.",
41 "default": 300,
42 "minimum": 1
43 },
44 "input": {
45 "title": "Input",
46 "type": "object",
47 "description": "Input for an actor you are testing.",
48 "prefill": { "foo": "bar" },
49 "editor": "json"
50 },
51 "testFunction": {
52 "title": "Test function",
53 "type": "string",
54 "description": "Custom function to test the finished run of the actor.",
55 "editor": "javascript",
56 "prefill": "async ({ input, $, request, response, html }) => {\n return {\n pageTitle: $('title').text(),\n };\n};"
57 }
58 },
59 "required": []
60}
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
1{
2 "name": "actors-name",
3 "version": "0.0.1",
4 "description": "Actors description",
5 "main": "main.js",
6 "dependencies": {
7 "apify": "^0.11.5",
8 "request-promise": "^4.2.2"
9 },
10 "scripts": {
11 "start": "node main.js"
12 },
13 "author": "Actor creators name"
14}
Developer
Maintained by Community
Actor Metrics
1 monthly user
-
1 star
>99% runs succeeded
Created in Feb 2019
Modified 6 years ago