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/$%7Bsuccess?q=api&page=40&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 11715 results for "api"(928ms)

myApi1 file match

@abhishekUpdated 1 year ago

wrapInHTMLElements2 file matches

@rwevUpdated 1 year ago

valtownOpenAPI2 file matches

@pomdtrUpdated 1 year ago

myApi1 file match

@tmcw_onboardingUpdated 1 year ago

myApi1 file match

@joemccourtUpdated 1 year ago

myApi1 file match

@tychioUpdated 1 year ago

myApi1 file match

@bacondotbuildUpdated 1 year ago

apiExample1 file match

@phelanUpdated 1 year ago

API_URL1 file match

@easrngUpdated 1 year ago

myApi1 file match

@fdterrUpdated 1 year ago

glastonewsindex.ts1 match

@bensomethingUpdated 25 mins ago
1import process from "node:process";
2import { BskyAgent } from "npm:@atproto/api";
3import fetch from "npm:node-fetch";
4import * as cheerio from "npm:cheerio";

whatsapp-callbackindex.tsx13 matches

@yawnxyzUpdated 2 hours 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);
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