Skip to content

When commuting to Stockholm the trains were delayed so often I created a scraper + headless form filler in AWS to earn compensation for my delays

Notifications You must be signed in to change notification settings

nermin99/malartag-web-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mälartåg Web Scraper

Delayed Mälartåg, gotta catch 'em all!

Install

npm install

AWS

  1. Create IAM user. If lazy, the AdministratorAccess permission is sufficient.

  2. Fill in IAM credentials in .env file.

cp .env.example .env
  1. Download the AWS CLI.

  2. Create a DynamoDB table. Replace malartag-scraper-table with your table name.

  3. Create a Lambda function. Replace malartag-scraper-function with your function name.

Lambda Function Configuration

  1. Set Timeout to 10 seconds minimum.

  2. Add environment variable NODE_ENV: production.

  3. Add the following permission (role name): AmazonDynamoDBFullAccess.

Run

npm start

Deploy

Make sure you are logged in to AWS CLI.

npm run zip
npm run updateLambda

Scheduling

Add AWS EventBridge trigger to your lambda function.

Schedule to run once every 24 hours at 03:00 UTC: cron(0 3 * * ? *).


Mälartåg Form Filler

See the form-filler directory for more information.

About

When commuting to Stockholm the trains were delayed so often I created a scraper + headless form filler in AWS to earn compensation for my delays

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published