This commit is contained in:
2026-04-24 14:03:17 +02:00
commit 0191347312
31 changed files with 16354 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env node
import { exit } from "node:process";
import { log } from "node:console";
import { users } from "../.env.js";
const credentials= users[0];
const host= "https://rss.jaandrle.cz/";
const Authorization= "Basic " + toBase64(credentials);
const headers= { Authorization, Accept: "application/json" };
const rootCategory= await fetch(host+"rest/category/get", { headers }).then(res=> res.json());
const unreadEntries= await fetch(host+"rest/category/entries?id=all&readType=unread", { headers }).then(res=> res.json());
log({
rootCategory,
unreadEntries,
});
exit(0);
function toBase64(data) {
const existsTextEncoder= typeof TextEncoder !== 'undefined';
if (!existsTextEncoder)
return btoa(data);
const existsUint8ArrayToBase64= typeof Uint8Array.prototype.toBase64 === 'function';
if (existsUint8ArrayToBase64)
return new TextEncoder().encode(data).toBase64();
const binString= Array.from(new TextEncoder().encode(data))
.map(x=> String.fromCharCode(x)).join("");
return btoa(binString);
}