Code Monkey home page Code Monkey logo

covid-vaccine-scrapers's Introduction

covid-vaccine-scrapers

Overview

This is the open-source portion of the back-end, website scraping software that powers www.macovidvaccines.com. Technologies used are Node JS and Puppeteer. In production, this code is run every 5 minutes via AWS Lambda, posting its results to a JSON file in an AWS S3 bucket.

Setup

  1. Download a recent version of Chromium locally: https://download-chromium.appspot.com/

  2. Create a .env file with the following:

    DEVELOPMENT=true
    CHROMEPATH="path/to/chromium/that/you/downloaded"
    # e.g. /Applications/Chromium.app/Contents/MacOS/Chromium
    PROPRIETARY_SITE_SCRAPERS_PATH="./../proprietary/site-scrapers" (optional, example)
    
  3. Install prettier and eslint; make sure you run them before making any commits.

Using this code

  1. In your terminal, install dependencies with npm install
  2. To run all scrapers: node main.js To run an individual scraper, specify the base filename from site-scrapers, e.g.: node main.js MAImmunizations to run site-scrapers/MAImmunizations.js
  3. If you have your own scrapers you want to add, mimic the structure of ./site-scrapers/ inside a folder structure named proprietary/site-scrapers. In your .env file, have the field PROPRIETARY_SITE_SCRAPERS_PATH set ./../proprietary/site-scrapers. This naming is recommended since the .gitignore lists the folder proprietary.
  4. When you're ready to deploy via AWS Lambda, run npm run predeploy which will generate lambda.zip for you. This needs to stay under 50 MB for you to upload it manually.
  5. Your production environment needs to have the environment variables AWSS3BUCKETNAME, AWSACCESSKEYID, and AWSSECRETACCESSKEY so that it can publish to S3. If you are inserting your own scrapers, set PROPRIETARY_SITE_SCRAPERS_PATH in production as well. If you have any scrapers that need to solve reCAPTCHAs, you will also need a RECAPTCHATOKEN from the 2captcha service.
Copyright 2021 Olivia Adams/Ora Innovations, LLC. All rights reserved.

covid-vaccine-scrapers's People

Contributors

livgust avatar dldereklee avatar johnhawkinson avatar zpeyton avatar adpjay avatar harcod avatar tkjones117 avatar kriation avatar benpatterson avatar iann avatar kathleen-francis avatar dragthemagicpuffin avatar

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.