Calendar scraper for cestlagreve.fr, a french website providing all strike dates in France.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Gitea b16cadeead Fix iCal date & description tags 4 months ago
demo Add iCal generator 4 months ago
lib Fix iCal date & description tags 4 months ago
.gitignore Initial commit 4 months ago
LICENSE Initial commit 4 months ago
README.md Fix iCal date & description tags 4 months ago
index.js Add iCal generator 4 months ago
package.json Fix iCal date & description tags 4 months ago

README.md

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 month
  • year : (integer, optional) YYYY format
    Defaults to current year
  • regionId : (integer, optional) As returned by getParams()
  • departmentId : (integer, optional) As returned by getParams()
  • departmentCode : (string, optional) French department code
  • sectorId : (string, optional) As returned by getParams()

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 french
  • link : (string) 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 release
  • 1.0.1 (2020-03-04) • Add filter by sector ID
  • 1.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 tags