Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Burl%7D?q=api&page=24&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 11714 results for "api"(675ms)

myApi1 file match

@chriscoUpdated 1 year ago

myApiDeleteAll2 file matches

@acmuUpdated 1 year ago

myApi1 file match

@dmac99Updated 1 year ago

myApi1 file match

@treejanitorUpdated 1 year ago

myApi1 file match

@briansUpdated 1 year ago

myApi1 file match

@pigrangeUpdated 1 year ago

myApi1 file match

@impactvelocityUpdated 1 year ago

myApi1 file match

@tmhUpdated 1 year ago

myApi1 file match

@sanjeevUpdated 1 year ago

myApi1 file match

@ypxUpdated 1 year ago

whatsapp-callbackindex.tsx13 matches

@yawnxyzUpdated 1 hour ago
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");
9
10// In-memory store for conversation histories (keyed by user's phone number)
35 console.log(`Sending to MCP for ${userIdentifier}:`, JSON.stringify(mcpPayload, null, 2));
36
37 const mcpApiResponse = await fetch("https://mcp.labspace.ai/chat", {
38 method: "POST",
39 headers: {
43 });
44
45 if (!mcpApiResponse.ok) {
46 const errorText = await mcpApiResponse.text();
47 console.error(`Error from MCP for ${userIdentifier}: ${mcpApiResponse.status} ${mcpApiResponse.statusText}`, errorText);
48 return { error: true, data: { text: "Sorry, I couldn't get a response from the assistant.", details: errorText, status: mcpApiResponse.status } };
49 } else {
50 const mcpResponseData = await mcpApiResponse.json();
51 console.log(`Response from MCP for ${userIdentifier}:`, JSON.stringify(mcpResponseData, null, 2));
52
84 console.log(`Message from: ${userPhoneNumber}, Query: ${userQuery}`);
85
86 if (WHATSAPP_GRAPH_API_TOKEN && business_phone_number_id) {
87 const result = await processQueryWithMCP(userQuery, userPhoneNumber);
88
104 method: "POST",
105 headers: {
106 "Authorization": `Bearer ${WHATSAPP_GRAPH_API_TOKEN}`,
107 "Content-Type": "application/json",
108 },
134 try {
135 console.log(`Attempting to mark message as read for ${userPhoneNumber} (message_id: ${message.id})`);
136 console.log("using API token:", WHATSAPP_GRAPH_API_TOKEN);
137 const markReadResponse = await fetch(
138 `https://graph.facebook.com/v18.0/${business_phone_number_id}/messages`,
140 method: "POST",
141 headers: {
142 "Authorization": `Bearer ${WHATSAPP_GRAPH_API_TOKEN}`,
143 "Content-Type": "application/json",
144 },
167 } else {
168 console.error(
169 "WHATSAPP_GRAPH_API_TOKEN or business_phone_number_id is missing.",
170 );
171 }
195
196 if (directQuery) {
197 const userIdentifier = "direct_api_user"; // Fixed identifier for direct API calls
198
199 const result = await processQueryWithMCP(directQuery, userIdentifier);
1import { createRoute } from "https://esm.sh/@hono/zod-openapi@0.18.4";
2import { ErrorSchema, UpdateUserSchema, UserIdPathParamSchema, UserSchema } from "../schema.ts";
3
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration