Na Spacir Registration Checker avatar
Na Spacir Registration Checker

Under maintenance

Pricing

Pay per usage

Go to Store
Na Spacir Registration Checker

Na Spacir Registration Checker

Under maintenance

Developed by

Kateřina Hroníková

Maintained by Community

Checks if there are free spots for Spacir ⛰️🚶‍♂️🚶‍♂️⛰️

0.0 (0)

Pricing

Pay per usage

1

Monthly users

0

Runs succeeded

>99%

Last modified

18 days ago

.actor/Dockerfile

1# Specify the base Docker image. You can read more about
2# the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images
3# You can also use any other image from Docker Hub.
4FROM apify/actor-node:16
5
6# Copy just package.json and package-lock.json
7# to speed up the build using Docker layer cache.
8COPY package*.json ./
9
10# Install NPM packages, skip optional and development dependencies to
11# keep the image small. Avoid logging too much and print the dependency
12# tree for debugging
13RUN npm --quiet set progress=false \
14    && npm install --omit=dev --omit=optional \
15    && echo "Installed NPM packages:" \
16    && (npm list --omit=dev --all || true) \
17    && echo "Node.js version:" \
18    && node --version \
19    && echo "NPM version:" \
20    && npm --version \
21    && rm -r ~/.npm
22
23# Next, copy the remaining files and directories with the source code.
24# Since we do this after NPM install, quick build will be really fast
25# for most source file changes.
26COPY . ./
27
28
29# Run the image.
30CMD npm start --silent

.actor/INPUT_SCHEMA.json

1{
2    "title": "Na Spacir Registration checker input",
3    "type": "object",
4    "schemaVersion": 1,
5    "properties": {
6        "email": {
7            "title": "Email",
8            "type": "string",
9            "description": "Where to send notification email",
10            "editor": "textfield"
11        }
12    },
13    "required": ["email"]
14}

.actor/actor.json

1{
2    "actorSpecification": 1,
3    "name": "na-spacir-registration-checker---copy",
4    "title": "Getting Started with Node.js",
5    "description": "Adds two integers.",
6    "version": "0.0",
7    "meta": {
8        "templateId": "js-start"
9    },
10
11    "dockerfile": "./Dockerfile"
12}

src/main.js

1// This is the main Node.js source code file of your actor.
2// An actor is a program that takes an input and produces an output.
3
4// For more information, see https://docs.apify.com/sdk/js/
5import { Actor } from 'apify';
6import { gotScraping } from 'got-scraping';
7import cheerio from 'cheerio';
8
9await Actor.init();
10const input = await Actor.getInput();
11const { body } = await gotScraping({ url:'http://naspacir.eu/o-spaciru/prihlaska/' });
12const $ = cheerio.load(body);
13const error = $('div.error:contains("Máme plno!")');
14    const plno = error.length && error.css('display')!=='none';
15    console.log('plno: '+!!plno);
16    if(!plno)
17    {
18        console.log('volno - sending email')
19        await Actor.call('apify/send-mail',
20        {
21            to: input.email,
22            subject: 'spacir volno',
23            text: 'http://naspacir.eu/o-spaciru/prihlaska/',
24            
25        });
26    }
27
28
29await Actor.exit();

.dockerignore

1# configurations
2.idea
3
4# crawlee and apify storage folders
5apify_storage
6crawlee_storage
7storage
8
9# installed files
10node_modules
11
12# git folder
13.git

package.json

1{
2    "name": "getting-started-node",
3    "version": "0.0.1",
4    "type": "module",
5    "description": "This is an example of an Apify actor.",
6    "dependencies": {
7        "apify": "^3.0.0",
8        "got-scraping":"*",
9        "cheerio": "*"
10    },
11    "devDependencies": {},
12    "scripts": {
13        "start": "node src/main.js",
14        "test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
15    },
16    "author": "It's not you it's me",
17    "license": "ISC"
18}

Pricing

Pricing model

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.