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/$2?q=function&page=2393&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 28557 results for "function"(8879ms)

sendxmppapimain.tsx1 match

@singpolyma•Updated 7 months ago
4const ratelimit = new RateLimit({ maximum: 2, interval: "30s" });
5
6export default async function(req: Request): Promise<Response> {
7 /*const limit = await ratelimit.check("val.town");
8 if (!limit.ok) {

sendxmppmain.tsx1 match

@singpolyma•Updated 7 months ago
1export default async function sendxmpp(target: string, body: string) {
2 await fetch("https://singpolyma-sendxmppapi.web.val.run", {
3 method: "POST",

getRandomFeedItemmain.tsx1 match

@xxxlovecola•Updated 7 months ago
1import Parser from "https://esm.sh/rss-parser@3.13.0";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 const feedUrl = url.searchParams.get("url");

getRandomNumbermain.tsx1 match

@xxxlovecola•Updated 7 months ago
1export default async function server(request: Request): Promise<Response> {
2 const url = new URL(request.url);
3 const min = parseInt(url.searchParams.get("min") || "2");

handlermain.tsx4 matches

@temptemp•Updated 7 months ago
15 year: number;
16}
17async function movieHandler(meta: Meta) {
18 const data = await scrapeMovie(meta.imdb_id);
19 let htmlData = "";
37 `;
38}
39async function showHandler(meta: Meta, s, e) {
40 const data = await scrapeShow(meta.imdb_id, s, e);
41 let htmlData = "";
59 `;
60}
61async function getMeta(imdbId: string): Promise<Meta> {
62 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
63 return await searchResult.json() as Meta;
64}
65
66export async function handler(imdbId: string, season: number, episode: number) {
67 const meta: Meta = await getMeta(imdbId) as Meta;
68 switch (meta.type) {

crossmintSolanaTxGeneratormain.tsx3 matches

@alfongj•Updated 7 months ago
6import { vscDarkPlus } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [input, setInput] = useState("");
10 const [response, setResponse] = useState("");
101}
102
103function client() {
104 createRoot(document.getElementById("root")).render(<App />);
105}
109}
110
111export default async function server(request: Request): Promise<Response> {
112 const { OpenAI } = await import("https://esm.town/v/std/openai");
113 const openai = new OpenAI();

sendxmpplibmain.tsx1 match

@singpolyma•Updated 7 months ago
3let xmpp: Client | null = null;
4
5export default async function sendxmpp(target: string, body: string, keepalive = false) {
6 if (!xmpp) {
7 return new Promise((resolve, reject) => {

worthyCyanRoundwormmain.tsx8 matches

@vawogbemi•Updated 7 months ago
81`;
82
83function Instructions() {
84 return (
85 <div className="mb-4">
95}
96
97function TipList({ tips, selectedDate, sortOrder, setSortOrder }) {
98 const filteredTips = tips.filter((tip) => {
99 const tipDate = new Date(tip.timestamp);
145}
146
147function DateSelector({ selectedDate, setSelectedDate }) {
148 const [isCalendarOpen, setIsCalendarOpen] = useState(false);
149 const today = new Date();
232}
233
234function App({ initialTips }) {
235 const [amount, setAmount] = useState(20);
236 const [name, setName] = useState("");
350}
351
352function Confetti() {
353 useEffect(() => {
354 confetti({
362}
363
364function SuccessPage({ payments }) {
365 return (
366 <div className="min-h-screen bg-white text-black flex flex-col items-center justify-center p-4">
387}
388
389function client() {
390 const root = document.getElementById("root");
391 if (root.dataset.page === "success") {
402}
403
404export default async function server(req: Request): Promise<Response> {
405 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
406 const SCHEMA_VERSION = 2;

forbearingAmethystToadmain.tsx8 matches

@vawogbemi•Updated 7 months ago
81`;
82
83function Instructions() {
84 return (
85 <div className="mb-4">
95}
96
97function TipList({ tips, selectedDate, sortOrder, setSortOrder }) {
98 const filteredTips = tips.filter((tip) => {
99 const tipDate = new Date(tip.timestamp);
145}
146
147function DateSelector({ selectedDate, setSelectedDate }) {
148 const [isCalendarOpen, setIsCalendarOpen] = useState(false);
149 const today = new Date();
232}
233
234function App({ initialTips }) {
235 const [amount, setAmount] = useState(20);
236 const [name, setName] = useState("");
350}
351
352function Confetti() {
353 useEffect(() => {
354 confetti({
362}
363
364function SuccessPage({ payments }) {
365 return (
366 <div className="min-h-screen bg-white text-black flex flex-col items-center justify-center p-4">
387}
388
389function client() {
390 const root = document.getElementById("root");
391 if (root.dataset.page === "success") {
402}
403
404export default async function server(req: Request): Promise<Response> {
405 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
406 const SCHEMA_VERSION = 2;

fluentAmberHyenamain.tsx3 matches

@deepmojo•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [domain, setDomain] = useState("");
7 const [crawlResults, setCrawlResults] = useState(null);
92}
93
94function client() {
95 createRoot(document.getElementById("root")).render(<App />);
96}
100}
101
102export default async function server(req: Request): Promise<Response> {
103 const url = new URL(req.url);
104

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.