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/?q=function&page=1349&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 18948 results for "function"(1292ms)

btcPriceAlertmain.tsx1 match

@kbarienti•Updated 5 months ago
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");

aqimain.tsx1 match

@kbarienti•Updated 5 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "region Hannover "; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

extutilmain.tsx5 matches

@gloodata•Updated 5 months ago
1export function replyJSON(data: any, status: number) {
2 return new Response(JSON.stringify(data), {
3 status,
6}
7
8export function replyText(data: string, status: number) {
9 return new Response(data, {
10 status,
13}
14
15export function opNotFoundError(opName: string) {
16 return {
17 ok: false,
21 };
22}
23function formatGetBody(url: string, info: ExtInfo) {
24 const { ns = "?", title = "?" } = info ?? {};
25 return `# ${title} (${ns})
44type HandleRequestFn = (info: any) => Promise<any>;
45
46export function makeExtServer(getInfo: GetInfoFn, handleRequest: HandleRequestFn) {
47 return async (req: Request) => {
48 if (req.method === "GET") {

socialDataSearchmain.tsx1 match

@stevekrouse•Updated 5 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function socialDataSearch(query: string): Promise<SocialDataResponse> {
4 const url = new URL("https://stevekrouse-socialdataproxy.web.val.run/twitter/search");
5 url.searchParams.set("query", query);

visionaryPeachAspmain.tsx6 matches

@stevekrouse•Updated 5 months ago
8type User = { id: string; username: string; tier: string };
9
10function SimpleLineChart({ data, width = 800, height = 400, margin = { top: 20, right: 20, bottom: 30, left: 40 } }) {
11 const chartWidth = width - margin.left - margin.right;
12 const chartHeight = height - margin.top - margin.bottom;
69}
70
71function Dashboard({ data }) {
72 const chartData = Object.keys(data[0].users).map(username => ({
73 name: username,
106}
107
108function App({ initialData }) {
109 const [data] = useState(initialData);
110
112}
113
114function client() {
115 const initialData = (window as any).INITIAL_DATA;
116 createRoot(document.getElementById("root")).render(<App initialData={initialData} />);
121}
122
123async function getUsageData() {
124 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
125 const result = await sqlite.execute(`
141}
142
143export default async function server(req: Request): Promise<Response> {
144 const url = new URL(req.url);
145

visionaryPeachAspREADME.md1 match

@stevekrouse•Updated 5 months ago
1A proxy that lets Val Town users get some free [SocialData](https://socialdata.tools) Search to power their Twitter Alerts, ie @stevekrouse/twitterAlert
2
3I reccomend interfacing with this proxy via this helper function: @stevekrouse/socialDataSearch

spectacularAzureAngelfishmain.tsx4 matches

@stevekrouse•Updated 5 months ago
15type UsageData = { username: string; usage_count: number; date: string };
16
17function UsageDashboard() {
18 const [usageData, setUsageData] = useState<UsageData[]>([]);
19
20 useEffect(() => {
21 async function fetchUsageData() {
22 const response = await fetch('/usage-data');
23 const data = await response.json();
85}
86
87function client() {
88 createRoot(document.getElementById("root")).render(<UsageDashboard />);
89}
90if (typeof document !== "undefined") { client(); }
91
92export default async function(req: Request): Promise<Response> {
93 const url = new URL(req.url);
94

spectacularAzureAngelfishREADME.md1 match

@stevekrouse•Updated 5 months ago
1A proxy that lets Val Town users get some free [SocialData](https://socialdata.tools) Search to power their Twitter Alerts, ie @stevekrouse/twitterAlert
2
3I reccomend interfacing with this proxy via this helper function: @stevekrouse/socialDataSearch

renderHTMLWithHonomain.tsx1 match

@tristanmagne•Updated 5 months ago
60});
61
62export default async function server(req: Request): Promise<Response> {
63 return app.fetch(req);
64}

sqliteExplorerAppREADME.md1 match

@mparker•Updated 5 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

getFileEmail4 file matches

@shouser•Updated 2 weeks 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": "*",