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.
 
KaKi87 40c6f48c49 🔧 Add 'yarn.lock' 2 days ago
demo Add iCal generator 3 years ago
lib ✏️ Fix 9c9b4eb 2 days ago
.gitignore Initial commit 3 years ago
LICENSE Initial commit 3 years ago
README.md 📝 Update changelog 2 days ago
index.js Add iCal generator 3 years ago
package.json 📝 Update changelog 2 days ago
yarn.lock 🔧 Add 'yarn.lock' 2 days 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, 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 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
  • 1.0.4 (2022-09-29) • Handle missing event link