Giter Club home page Giter Club logo

serverless-web-differ's Introduction

Serverless Web Differ

A serverless web browser which crawls websites and compares pages by schedule, with Serverless, AWS Lambda, Headless Chrome and Selenium!

What it can do | Prerequisites | Configuration | Deploy

What it can do

  • Runs headless chrome in a serverless environement.
  • Finds web elements with xpath and compares it.
  • Send notifications/emails if something has changed.

Prerequisites

  1. You need to have a aws account, aws_access_key_id and aws_secret_access_key. If you don't an account yet, go to here to sign up for one, and then follow the instructions here to get the key_id and access key.
  2. Install node and make sure npm is available in your path.
  3. Install docker from here.
  4. Install Serverless: npm install -g serverless
  5. Configure serverless with aws, using the aws_access_key_id and aws_secret_access_key from step 0: sls config credentials -p aws -k aws_access_key_id -s aws_secret_access_key
  6. Clone this project: git clone https://github.com/LeiShi1313/serverless-web-differ.git
  7. Install the dependencies: cd serverless-web-differ && npm install

Configuration

There are couple of things you need to configure before actually make the function running in the cloud. First you need to create a file called config.yml and copy/paste everything from config.yml.example. Inside the config.yml:

  • events: This is the place you can define what is the frequency the function runs, you can read more from here. But most of the time, you want one entry like - schedule: rate(1 hour) or - schedule: cron(0 * * * ? *), which both means run the function every hour.
  • server_chan/sendgrid/ifttt/pushbullet: There are the pre-defined ways to notify you if something has changed on the websites you interested. You can read the comments to find out how to get the security keys.
  • websites: This is the main configuration part. websites can have multiple entries, and each one represents a website you want to periodically check. url and xpath is easy to understand, if you don't know how to get the xpath, try search xpath [THE BROWSER YOU ARE USING], you should be able to find a lot of informations. For original, actually it can be absent if you are expecting a web element will appear, otherwise the function will compare the EXACT text from original and the web element of the web page by xpath.

Deploy

This is simple, when everything is all set, run:

sls deploy

and 🎉🎉🎉

TODO

  • Add Chinese ver. README.
  • For each website, deploy a lambda function instead of visiting all websites in one function.
  • Make notify.py another lambda function.
  • Add more ways to notify.
  • Maybe move notify.py to another project and make a submodule here?
  • Provide a headerless chrome docker image
  • Options for other cloud provider: Google Cloud, Aliyun, etc

serverless-web-differ's People

Contributors

dependabot[bot] avatar leishi1313 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

serverless-web-differ's Issues

Depfu Error: No dependency files found

Hello,

We've tried to activate or update your repository on Depfu and couldn't find any supported dependency files. If we were to guess, we would say that this is not actually a project Depfu supports and has probably been activated by error.

Monorepos

Please note that Depfu currently only searches for your dependency files in the root folder. We do support monorepos and non-root files, but don't auto-detect them. If that's the case with this repo, please send us a quick email with the folder you want Depfu to work on and we'll set it up right away!

How to deactivate the project

  • Go to the Settings page of either your own account or the organization you've used
  • Go to "Installed Integrations"
  • Click the "Configure" button on the Depfu integration
  • Remove this repo (LeiShi1313/serverless-web-differ) from the list of accessible repos.

Please note that using the "All Repositories" setting doesn't make a lot of sense with Depfu.

If you think that this is a mistake

Please let us know by sending an email to [email protected].


This is an automated issue by Depfu. You're getting it because someone configured Depfu to automatically update dependencies on this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.