Giter VIP home page Giter VIP logo

g5-asset-scraper's Introduction

g5-asset-scraper

An extensible website crawler that scrapes relevant location information and assets for onboarding.

Develop

Clone Repo Install deps Start Redis Define variables Run locally Test with API Run Unit Tests Deploy with Docker and Helm

Request Body

The post payload accepts a JSON body.

{
  "rootProtocol": "https",
  "vertical": "MF",
  "locationProjectId": 1234, // the ID for the row in the locationProjects table of the Onboarder
  "rootDomain": "example.com",
  "pages": [],
  "scrapers": {},
  "template": {},
  "config": {},
  "amenitiesConfig": {
    "apartmentAmenities": [],
    "communityAmenities": []
  }
}

To submit a job locally, here's an example:

gcloud pubsub topics publish asset-responses-2 --message='{"vertical":"MF","rootdomain":"livexavier.com","rootProtocol":"http","locationId":9999,"pages":["https://livexavier.com/","https://livexavier.com/galleries"],"scrapers":{"photos":true,"amenities":true,"address":true,"emails":true,"phoneNumber":true,"social":true},"template":{"address":{"selector":null},"phone":{"selector":null},"email":{"selector":null},"social":{"selector":null},"amenities":{"selector":null,"slug":null}},"amenitiesConfig":{"community_amenities":[{"text":"Basketball Court","value":"basketballCourt","variants":["basketball"]},{"text":"Business Center","value":"businessCenter","variants":[]},{"text":"Carport Parking Available","value":"carportParking","variants":["carport"]},{"text":"Close to Dog Park","value":"closeToDogPark","variants":["near a dog park","by a dog park"]}],"apartment_amenities":[{"text":"Air Conditioning","value":"airConditioning","variants":["air conditioner","ac"]},{"text":"Cable Included","value":"cableIncluded","variants":[]}]},"config":{"photos":{"folder":"onboarder-temporary/__tests__/a0E3l00000MwvHTEST"}}}'

This will return a message id is published successfully.

Pub Sub Worker

Deployed as a private service, the API will not be accessible on the internet, so it uses pubsub to handle IO.

Checkout the branch you wish to deploy. Set the Kubernetes context you want to deploy to. Run npm run deploy

Override defaults by running

./upgrade.sh -t <tag> -p <project> -d <deployment_name>

Helm Dependencies

If you encounter issues deploying, it might be because your system does not have access to G5 helpers.

GCS Helm Plugin

helm repo add g5-multiverse-helm3-repositories gs://g5-multiverse-helm3-repositories
helm plugin install https://github.com/hayorov/helm-gcs.git
helm plugin update gcs
helm gcs init gs://g5-multiverse-helm3-repositories
helm dep up

g5-asset-scraper's People

Contributors

pcktbot avatar colinmccullough avatar tylrhas avatar aaronwebre avatar johnnyarcher avatar

Stargazers

Bonnie Vroom avatar

Watchers

James Cloos avatar  avatar  avatar  avatar Bonnie Vroom 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.