@replicate1 project
Updated 4 days ago
Run AI with an API
@rapilot3302 projects
Updated 4 days ago
@YoungPapi1 project
Updated 4 days ago
@codingpapi1 project
Updated 4 days ago
You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg%20%22Image%20title%22?q=api&page=2&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=api
Returns an array of strings in format "username" or "username/projectName"
Found 11633 results for "api"(686ms)
264==========================*/
265// The server function remains the same as in the previous single-file solution,
266// as it handles API requests and serves the main HTML.
267// Its logic is independent of how the client-side components are structured into files.
268export default async function server(
316const method = request.method;
317318// API Routes (same logic as before)
319if (path === "/login" && method === "POST") {
320const body = await request.json();
433}
434435// API endpoint to handle editing a news article
436if (path === "/edit-news" && method === "PUT") {
437try {
558}
559560// --- End Media Monitoring Specific API Routes ---
561// --- NEW ENDPOINT: Generate Weekly Summary ---
562if (path === "/generate-weekly-summary" && method === "GET") {
9798export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
99// Get API keys from environment
100const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
101const telegramToken = Deno.env.get("TELEGRAM_TOKEN");
102106}
107108if (!apiKey) {
109console.error("Anthropic API key is not configured.");
110return;
111}
122123// Initialize Anthropic client
124const anthropic = new Anthropic({ apiKey });
125126// Initialize Telegram bot
162163// disabled title for now, it seemes unnecessary...
164// await bot.api.sendMessage(chatId, `*${title}*`, { parse_mode: "Markdown" });
165166// Then send the main content
169170if (content.length <= MAX_LENGTH) {
171await bot.api.sendMessage(chatId, content, { parse_mode: "Markdown" });
172// Store the briefing in chat history
173await storeChatMessage(
198// Send each chunk as a separate message and store in chat history
199for (const chunk of chunks) {
200await bot.api.sendMessage(chatId, chunk, { parse_mode: "Markdown" });
201// Store each chunk in chat history
202await storeChatMessage(