A Javascript client to scrape data from Bike Sampa, a bicycle sharing system in São Paulo.
npm install codigourbano/bikesampa-scraper
The following code will log to console station names and bikes available:
var scraper = require('bikesampa-scraper');
scraper.scrape(function(err,stations){
if (err) return console.log(err);
for (var i = 0; i < stations.length; i++) {
var st = stations[i];
console.log(st.name + ': '+ st.units);
}
});Write tests and run:
npm test
Currently tests are made directly to the live map.