0.0.0 • Published 6 years ago
sratter v0.0.0
sratter
the worts scrapper for the peruvian congress website
Development
- Install dependencies using
npm install
- Create a .env file with the following variables
CONGRESS_URL_BASE=http://www.congreso.gob.pe/
CONGRESS_URL_LIST=congresistas
Usage
- Get all the information of the last period of the congress
const srapper = require('srapper');
srapper
.listAll()
.then((people) => {
//do something with the information here
});
- Get information from other period rather than the last one
const srapper = require('srapper');
srapper
.listAll(6) // six means the period 2011 - 2016
.then((people) => {
//do something with the information here
});
Data Structure
- The listAll method will return you an array of objects
[
{
id: 1, // an arbitrary index
email: 'racuna@congreso.gob.pe',
fullName: 'Acuña Núñez Richard Frank',
image: 'http://www.congreso.gob.pe/Storage/tbl_congresistas/fld_47_Fotografia_file/802-o5Bb5Jd3Ns0Gr4I.jpg',
party: 'ALIANZA PARA EL PROGRESO',
},
]
I do not care about your silly package, give me the data
- Ok ok, slow down little man, here you have the list of the last period
http://www.jsoneditoronline.org/?id=206b733c480dde6801707e1224022fad
0.0.0
6 years ago
0.0.0-development
6 years ago