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=fetch&page=4&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=fetch
Returns an array of strings in format "username" or "username/projectName"
Found 8251 results for "fetch"(344ms)
42const handleLogin = async (username, password) => {
43try {
44const response = await fetch("/login", {
45method: "POST",
46headers: { "Content-Type": "application/json" },
377}
378379if (path === "/fetch-news" && method === "GET") {
380const newsArticles = await sqlite.execute(`SELECT * FROM ${KEY}_news_articles ORDER BY created_at DESC`);
381return new Response(JSON.stringify({ articles: newsArticles.rows }), {
384}
385386if (path === "/fetch-media" && method === "GET") {
387const mediaEntries = await sqlite.execute(`SELECT * FROM ${KEY}_media_monitoring ORDER BY created_at DESC`);
388return new Response(JSON.stringify({ entries: mediaEntries.rows }), {
476477if (result.rowsAffected > 0) {
478// Fetch the updated article to return it to the client
479const updatedArticle = await sqlite.execute(`SELECT * FROM ${KEY}_news_articles WHERE id = ?`, [id]);
480487// This case should ideally not happen if rowsAffected > 0, but good for robustness
488return new Response(
489JSON.stringify({ success: false, message: "Article updated but could not be refetched" }),
490{
491status: 500, // Internal Server Error
538539if (result.rowsAffected > 0) {
540// Fetch the updated entry to return it
541const updatedEntry = await sqlite.execute(`SELECT * FROM ${KEY}_media_monitoring WHERE id = ?`, [id]);
542return new Response(JSON.stringify({ success: true, entry: updatedEntry.rows[0] }), {
573const sevenDaysAgoISO = sevenDaysAgo.toISOString(); // e.g., "2023-10-27T10:00:00.000Z"
574575// Fetch news article counts per author in the last 7 days
576const newsCountsResult = await sqlite.execute(
577`
584);
585586// Fetch media monitoring counts per author in the last 7 days
587const mediaCountsResult = await sqlite.execute(
588`
135const lastSunday = today.startOf("week").minus({ days: 1 });
136137// Fetch relevant memories using the utility function
138const memories = await getRelevantMemories();
139