Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import process from "node:process";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export async function gitlabUserContributionEvents(afterDateMs) {
const after = new Date(afterDateMs).toISOString().split("T")[0];
console.log(after);
// https://docs.gitlab.com/ee/api/events.html#get-user-contribution-events
let userEvents = await fetchJSON(
`gitlab.com/api/v4/users/rwev/events?after=${after}`,
{
headers: {
Authorization: `Bearer ${process.env.GITLAB_API_READ_USER}`,
},
}
);
// console.log(userEvents);
return userEvents;
}
October 23, 2023