DEPRECATED - Calculate the Top Site Compatibility Index metric
Перейти к файлу
Panagiotis Astithas b071453dcc Use the latest stable version of Node.js 2019-06-27 16:55:32 -07:00
.eslintrc.js Add Travis CI support for linting 2019-06-27 16:51:20 -07:00
.gitignore Use a config.json file for all configurable constants 2019-05-28 15:13:58 -07:00
.travis.yml Use the latest stable version of Node.js 2019-06-27 16:55:32 -07:00
CODE_OF_CONDUCT.md Add Mozilla's CoC 2019-06-14 14:40:50 -07:00
README.md Append to an existing spreadsheet if a spreadsheetId is provided (fixes #18) 2019-06-26 20:13:36 -07:00
bugs.js Issue #58 - Filter out any webcompat.com bugs with sci-exclude label 2019-06-26 22:04:50 -05:00
config.json.example Append to an existing spreadsheet if a spreadsheetId is provided (fixes #18) 2019-06-26 20:13:36 -07:00
index.js Append to an existing spreadsheet if a spreadsheetId is provided (fixes #18) 2019-06-26 20:13:36 -07:00
package-lock.json Add Travis CI support for linting 2019-06-27 16:51:20 -07:00
package.json Add Travis CI support for linting 2019-06-27 16:51:20 -07:00
spreadsheet.js Address review comments 2019-06-27 09:27:03 -07:00
tranco.js Converge towards the present for unavailable lists on future or past dates (fixes #52) 2019-06-24 17:20:16 -07:00

README.md

tsci

Calculate the Top Site Compatibility Index web compat metric.

Usage

Requires Node 8+ and a Google Cloud Platform service account. You need to create a service account and download the JSON file containing the authentication credentials. Put that file in the project workspace as credentials.json.

Copy config.json.example in the project workspace to a file named config.json and edit accordingly, notably the API keys for Bugzilla and GitHub. You can omit any keys where the defaults would suffice. Here is what a commented config.json.example would look like:

{
  // The size of the Tranco list to download, up to 1 million sites.
  "listSize": 500,
  // The directory that will be used to store the downloaded list.
  "listDir": "data/",
  // The Bugzilla API authentication key.
  "bugzillaKey": "",
  // The GitHub API authentication key.
  "githubKey": "",
  // A list of domains to ignore when fetching bug results.
  "ignoredDomains": [
    "github.com",
    "github.io",
    "t.co"
  ],
  // A cutoff date for calculating the TSCI (if not a Sunday, will be rounded to the next Sunday).
  // E.g. a value of "2019-03-01" would lead to using "2019-03-03" (March 1st was a Friday).
  "maxDate": null,
  // The ID of a spreadsheet to append to.
  "spreadsheetId": null,
  // A list of Google accounts with whom the final spreadsheet should be shared.
  "writers": [
    "user@example.com"
  ]
}

Then run:

npm install
npm start

A single argument may also be provided to specify a cut-off date, providing a best-effort view of what the historical results would have been, had the program been run at that date. Note that the end of the week for the given date is what is actually used, regardless of the day-of-week specified. For instance, this will return issue-counts up to and including Saturday May 25 2018:

npm start 2019-05-23

Code of Conduct

This project and repository is governed by Mozilla's code of conduct and etiquette guidelines. For more details please see the `CODE_OF_CONDUCT.md file.