cestlagreve-strikes
v1.0.4
Published
Calendar scraper for [cestlagreve.fr](https://www.cestlagreve.fr/), a french website providing all strike dates in France.
Downloads
6
Readme
cestlagreve-strikes
Calendar scraper for cestlagreve.fr, a french website providing all strike dates in France.
Getting started
Prerequisites
- NodeJS
- NPM
- Yarn
Install
From npm
yarn add cestlagreve-strikes
or
npm i cestlagreve-strikes --save
Use
const cestlagreve = require('cestlagreve-strikes');
Get parameters
cestlagreve.getParams().then(console.log)
Returns this.
Get strikes
cestlagreve.getStrikes({
month,
year,
regionId,
departmentId,
departmentCode,
sectorId
}).then(console.log)
Params :
month
: (integer, optional) MM format Defaults to current monthyear
: (integer, optional) YYYY format Defaults to current yearregionId
: (integer, optional) As returned bygetParams()
departmentId
: (integer, optional) As returned bygetParams()
departmentCode
: (string, optional) French department codesectorId
: (string, optional) As returned bygetParams()
Note : defining more than one of the last 3 parameters would be pointless.
Returns an array (days of month) of arrays (strikes of day) with the following properties :
name
: (string) Event name in frenchlink
: (string, optional) URL to related blog article in french
Get iCal
cestlagreve.getIcal(options).then(console.log)
Params : same as getStrikes()
Note : This function will fetch all available future events (including next months).
Returns this
Changelog
1.0.0
(2020-03-03) • Initial release1.0.1
(2020-03-04) • Add filter by sector ID1.0.2
(2020-03-04)- Fix current month beginning with last days of previous month
- Add iCal generator
1.0.3
(2020-03-04) • Fix iCal date & description tags1.0.4
(2022-09-29) • Handle missing event link