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=function&page=4&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 18011 results for "function"(1179ms)

aqimain.tsx1 match

@rhl•Updated 4 hours ago
4const location = "koetsierbaan 87, almere, netherlands"; // <-- change to place, city, or zip code
5
6export async function aqi(interval: Interval) {
7 const data = await easyAQI({ location });
8 if (!interval.lastRunAt) {

aqiutils.ts2 matches

@rhl•Updated 4 hours ago
48const cacheKey = (location: string) => "easyAQI_v3_" + encodeURIComponent(location);
49
50export async function openAqNowcastAQI(location) {
51 const sensorID = location.sensors.find(s => s.parameter.name === "pm25").id;
52 const data = await fetchJSON(
64}
65
66export async function easyAQI({ location }: {
67 location: string;
68}) {

aqiproxy.ts1 match

@rhl•Updated 4 hours ago
1const TARGET_URL = "https://api.openaq.org";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 return fetch(TARGET_URL + url.pathname + url.search, {

aqinominatim.ts1 match

@rhl•Updated 4 hours ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?"

spag_migratedmain.tsx1 match

@dbn12•Updated 4 hours ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 const path = new URL(req.url).pathname;
5

yc_findermain.tsx5 matches

@dbn12•Updated 4 hours ago
23`;
24
25function Hero() {
26 return (
27 <div className="hero">
32}
33
34function HowItWorks() {
35 return (
36 <div className="how-it-works">
53}
54
55function App() {
56 const [ycCompanies, setYcCompanies] = useState<YCCompany[]>([]);
57 const [mergedData, setMergedData] = useState<any[]>([]);
217}
218
219function client() {
220 createRoot(document.getElementById("root")!).render(<App />);
221}
225}
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);

testProj2test_http.tsx1 match

@vtTestLocal•Updated 6 hours ago
1export default async function (req: Request): Promise<Response> {
2 console.log("test");
3 return new Response(

stevensDemohandleTelegramMessage.ts5 matches

@kuanche•Updated 7 hours ago
30 * Store a chat message in the database
31 */
32export async function storeChatMessage(
33 chatId,
34 senderId,
63 * Retrieve chat history for a specific chat
64 */
65export async function getChatHistory(chatId, limit = 50) {
66 try {
67 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
88 * Format chat history for Anthropic API
89 */
90function formatChatHistoryForAI(history) {
91 const messages = [];
92
112 * Analyze a Telegram message and extract memories from it
113 */
114async function analyzeMessageContent(
115 anthropic,
116 username,
487
488// Handle webhook requests
489export default async function(req: Request): Promise<Response> {
490 // Set webhook if it is not set yet
491 if (!isEndpointSet) {

FeedPondmain.js1 match

@elouan•Updated 7 hours ago
10await initializeAggregatorDB();
11
12export default async function(req: Request): Promise<Response> {
13 const url = new URL(req.url);
14 const path = url.pathname.toLowerCase();

FeedPondfrontend.js1 match

@elouan•Updated 7 hours ago
1// frontend.js
2
3export function serveFrontend(req: Request): Response {
4 const feedUrl = `https://${Deno.env.get("USER")}-${Deno.env.get("NAME")}.web.val.run/feed.xml`;
5

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",