You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=api&page=28&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 11678 results for "api"(538ms)
153async function getDiscussionPosts(discussionId: string): Promise<PostT[]> {
154// Used to get the list of post id's for the discussion.
155const discussionRes = await fetch(`${server}/api/discussions/${discussionId}`);
156const discussionResJson = await discussionRes.json();
157165166await Promise.all(chunks.map(async (c: string[]) => {
167const postRes = await fetch(`${server}/api/posts?filter[id]=${c.join(",")}`);
168const postJson = await postRes.json();
169
9192export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
93// Get API keys from environment
94const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
95const telegramToken = Deno.env.get("TELEGRAM_TOKEN");
96100}
101102if (!apiKey) {
103console.error("Anthropic API key is not configured.");
104return;
105}
116117// Initialize Anthropic client
118const anthropic = new Anthropic({ apiKey });
119120// Initialize Telegram bot
156157// disabled title for now, it seemes unnecessary...
158// await bot.api.sendMessage(chatId, `*${title}*`, { parse_mode: "Markdown" });
159160// Then send the main content
163164if (content.length <= MAX_LENGTH) {
165await bot.api.sendMessage(chatId, content, { parse_mode: "Markdown" });
166// Store the briefing in chat history
167await storeChatMessage(
192// Send each chunk as a separate message and store in chat history
193for (const chunk of chunks) {
194await bot.api.sendMessage(chatId, chunk, { parse_mode: "Markdown" });
195// Store each chunk in chat history
196await storeChatMessage(