You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg?q=api&page=46&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 11752 results for "api"(1710ms)
6// Retrieve environment variables
7const WHATSAPP_WEBHOOK_VERIFY_TOKEN = Deno.env.get("WHATSAPP_WEBHOOK_VERIFY_TOKEN");
8const WHATSAPP_GRAPH_API_TOKEN = Deno.env.get("WHATSAPP_GRAPH_API_TOKEN");
910// In-memory store for conversation histories (keyed by user's phone number)
36console.log(`Sending to MCP for ${userIdentifier}:`, JSON.stringify(mcpPayload, null, 2));
3738const mcpApiResponse = await fetch("https://mcp.labspace.ai/chat", {
39method: "POST",
40headers: {
44});
4546if (!mcpApiResponse.ok) {
47const errorText = await mcpApiResponse.text();
48console.error(`Error from MCP for ${userIdentifier}: ${mcpApiResponse.status} ${mcpApiResponse.statusText}`, errorText);
49return { error: true, data: { text: "Sorry, I couldn't get a response from the assistant.", details: errorText, status: mcpApiResponse.status } };
50} else {
51const mcpResponseData = await mcpApiResponse.json();
52console.log(`Response from MCP for ${userIdentifier}:`, JSON.stringify(mcpResponseData, null, 2));
5385console.log(`Message from: ${userPhoneNumber}, Query: ${userQuery}`);
8687if (WHATSAPP_GRAPH_API_TOKEN && business_phone_number_id) {
88const result = await processQueryWithMCP(userQuery, userPhoneNumber);
89105method: "POST",
106headers: {
107"Authorization": `Bearer ${WHATSAPP_GRAPH_API_TOKEN}`,
108"Content-Type": "application/json",
109},
135try {
136console.log(`Attempting to mark message as read for ${userPhoneNumber} (message_id: ${message.id})`);
137console.log("using API token:", WHATSAPP_GRAPH_API_TOKEN);
138const markReadResponse = await fetch(
139`https://graph.facebook.com/v18.0/${business_phone_number_id}/messages`,
141method: "POST",
142headers: {
143"Authorization": `Bearer ${WHATSAPP_GRAPH_API_TOKEN}`,
144"Content-Type": "application/json",
145},
168} else {
169console.error(
170"WHATSAPP_GRAPH_API_TOKEN or business_phone_number_id is missing.",
171);
172}
196197if (directQuery) {
198const userIdentifier = "direct_api_user"; // Fixed identifier for direct API calls
199
200const result = await processQueryWithMCP(directQuery, userIdentifier);
1import fetch from "npm:node-fetch";
2import process from "node:process";
3import { BskyAgent } from "npm:@atproto/api";
4import * as cheerio from "npm:cheerio";
5