pad.libre-service.eu-etherpad/bin/plugins/stalePlugins.ts

25 lines
752 B
TypeScript
Raw Normal View History

2024-03-13 20:31:29 +01:00
'use strict';
// Returns a list of stale plugins and their authors email
import axios from 'axios'
2024-08-08 21:23:10 +02:00
import process from "node:process";
2024-03-13 20:31:29 +01:00
const currentTime = new Date();
(async () => {
const res = await axios.get<string>('https://static.etherpad.org/plugins.full.json');
for (const plugin of Object.keys(res.data)) {
// @ts-ignore
const name = res.data[plugin].data.name;
// @ts-ignore
const date = new Date(res.data[plugin].time);
const diffTime = Math.abs(currentTime.getTime() - date.getTime());
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
if (diffDays > (365 * 2)) {
// @ts-ignore
console.log(`${name}, ${res.data[plugin].data.maintainers[0].email}`);
}
}
2024-08-08 21:23:10 +02:00
process.exit(0)
2024-03-13 20:31:29 +01:00
})();