0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 01:11:24 +01:00

use github key/secret to increase rate limits when fetching contributors

This commit is contained in:
Rich Harris 2019-04-17 13:04:42 -04:00
parent 519059f7d8
commit 1e9223aff6

View File

@ -1,3 +1,4 @@
require('dotenv/config');
const fs = require('fs');
const fetch = require('node-fetch');
const Jimp = require('jimp');
@ -7,7 +8,7 @@ process.chdir(__dirname);
const SIZE = 64;
async function main() {
const res = await fetch(`https://api.github.com/repos/sveltejs/svelte/stats/contributors`);
const res = await fetch(`https://api.github.com/repos/sveltejs/svelte/stats/contributors?client_id=${process.env.GITHUB_CLIENT_ID}&client_secret=${process.env.GITHUB_CLIENT_SECRET}`);
const contributors = await res.json();
const authors = contributors