house-gov-page-scraper
v0.1.1
Published
a node module for scraping info from the US House of Representatives website: house.gov
Downloads
36
Maintainers
Readme
House.gov Page Scraper
Scrapes the representative finder on House.gov.
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