0.1.1 • Published 7 years ago

house-gov-page-scraper v0.1.1

Weekly downloads
7
License
ISC
Repository
github
Last release
7 years ago

House.gov Page Scraper

Scrapes the representative finder on House.gov.

CircleCI Coverage Status Dependency Status Dev Dependency Status Known Vulnerabilities

Requirements

Requires NodeJS version 4.3.2 or greater.

Installation

$ npm install house-gov-page-scraper --save

Usage

Returns a promises, using Request-Promise-Native for http GET requests.

var scraper = require('house-gov-page-scraper');

scraper.getDistrictsInZip(90210)
    .then(function(result) {
        console.log(result); // outputs [ 'CA-28', 'CA-30', 'CA-33' ]
    });

Note: If a zip code is 4 digits, input as a 5 character string:

scraper.getDistrictsInZip('02109')
    .then(function(result) {
        console.log(result); // outputs [ 'MA-8' ]
    });

Tests

$ npm test

Contributing

Code is transpiled from ES6/ES2015. You can lint code by running:

$ npm run lint