3export const rateArticleRelevance = async (interests: string, article: any) => {
4 const { default: OpenAI } = await import("npm:openai");
5 const openai = new OpenAI({ apiKey: process.env.OPENAI_KEY });
6
7 try {
1export async function isSupported(jsInterface) {
2 const caniuse = await import("npm:caniuse-api");
3 return caniuse.getSupport("border-radius");
4}
4export let unsplashF = (token) =>
5 fetchJSON(
6 `https://api.unsplash.com/photos`,
7 {
8 headers: {
4const model = new ChatOpenAI({
5 temperature: 0.9,
6 openAIApiKey: process.env.openai,
7});
8
38 if (!name) throw new Error("Cannot get cat");
39 const result: any[] = [];
40 for (const re of html.matchAll(/data-apireq="(.[^"]+)"/g)) {
41 const encoded = re[1];
42 const decoded: {
63 const ep = cat.find((c) => c.episode.startsWith(String(episode)));
64 if (!ep) throw new Error("Episode not exists");
65 const res = await fetch("https://v.anime1.me/api", {
66 method: "POST",
67 headers: {
1Migrated from folder: api/crux_add
1import { callGoogleSheetsAPI } from "https://esm.town/v/clayway/callGoogleSheetsAPI";
2import { extractReceiptInfo } from "https://esm.town/v/clayway/extractReceiptInfo";
3import process from "node:process";
37 } = result;
38 try {
39 await callGoogleSheetsAPI({
40 sheetId: process.env.BUDGET_SHEET_ID,
41 serviceAccount: process.env.GOOGLE_SERVICE_ACCOUNT,
13 `${process.env.reddit_client_id}:${process.env.reddit_client_secret}`,
14 ).toString("base64");
15 const response = await fetch("https://www.reddit.com/api/v1/access_token", {
16 method: "POST",
17 body: formData,
24
25 try {
26 response = await fetch("https://www.reddit.com/api/v1/access_token", {
27 headers: headers,
28 method: "POST",
11}) {
12 const topUser = whoami().at(-1).slice(1).split(".")[0];
13 const verifyPublicKey = await __utils__.api(topUser + ".vsPublicKey");
14 if (verifyPublicKey !== keys.publicKey)
15 throw new Error("keypair doesn't match @" + topUser + ".vsPublicKey()");