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=fetch&page=131&format=json

For typeahead suggestions, use the /typeahead endpoint:

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

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

Found 8656 results for "fetch"(1816ms)

stevensDemosendDailyBrief.ts1 match

@swriddle•Updated 3 weeks ago
135 const lastSunday = today.startOf("week").minus({ days: 1 });
136
137 // Fetch relevant memories using the utility function
138 const memories = await getRelevantMemories();
139

dbToAPI_backupmockapi.tsx1 match

@nbbaier•Updated 3 weeks ago
20
21const app = await createServer(mock(), { auth: { username: "nb", password: "123" } });
22export default app.fetch;

twitterCardstweetThings.ts2 matches

@nbbaier•Updated 3 weeks ago
1import { fetchTweet, makeFriendly, transformTweet } from "https://esm.town/v/nbbaier/twitterCards/tweetCardUtils.ts";
2import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
3
12
13for (const url of urls) {
14 const tweet = await fetchTweet(url);
15 const tweetData = transformTweet(tweet);
16

twitterCardstweetCard.tsx2 matches

@nbbaier•Updated 3 weeks ago
9 TweetVideo,
10} from "https://esm.town/v/nbbaier/twitterCards/tweetCardTypes.ts";
11import { fetchTweet, makeFriendly, transformTweet } from "https://esm.town/v/nbbaier/twitterCards/tweetCardUtils.ts";
12
13const BASE_URL = new URL("https://api.fxtwitter.com");
17const url = new URL(targetURL.pathname, BASE_URL);
18
19const tweet = await fetchTweet(url);
20const tweetData = transformTweet(tweet);
21

twitterCardstweetCardUtils.ts2 matches

@nbbaier•Updated 3 weeks ago
57}
58
59export async function fetchTweet(url: URL | string): Promise<APITweet> {
60 const response = await fetch(url);
61 const { tweet } = (await response.json()) as {
62 code: number;

twitterCardsmain.tsx2 matches

@nbbaier•Updated 3 weeks ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=45";
2
3interface TwitterPost {
18 const url =
19 "https://publish.twitter.com/oembed?url=https%3A%2F%2Ftwitter.com%2FInterior%2Fstatus%2F507185938620219395";
20 const res = (await fetchJSON(url)) as TwitterPost;
21
22 return new Response(res.html, { headers: { "content-type": "text/html" } });

utilitiesemptyValUtils.ts3 matches

@nbbaier•Updated 3 weeks ago
1import { fetchPaginatedData } from "https://esm.town/v/nbbaier/fetchPaginatedData";
2import { deleteVal } from "https://esm.town/v/neverstew/deleteVal";
3
4export async function listEmptyVals(id: string) {
5 const token = Deno.env.get("valtown");
6 const res = await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
7 headers: { Authorization: `Bearer ${token}` },
8 });
12export async function deleteEmptyVals(id: string) {
13 const token = Deno.env.get("valtown");
14 const res = await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
15 headers: { Authorization: `Bearer ${token}` },
16 });

dbToAPI_backupexample.tsx1 match

@nbbaier•Updated 3 weeks ago
4const app = await createServer(db);
5
6export default app.fetch;

FarcasterMiniAppStoreHome.tsx4 matches

@moe•Updated 3 weeks ago
6
7import { Button, Input, Section, ShareButton } from "../components/ui.tsx";
8import { fetchNeynarGet, fetchNeynarGetPages, fetchUsersById } from "../util/neynar.ts";
9import { useQuery } from "../util/useQuery.ts";
10
38function MiniApps() {
39 const { data: miniapps } = useQuery(["miniapps"], async () => {
40 // return await fetch(`/api/miniapps`).then(r => r.json()).then(r => r);
41 // return await fetchNeynarGet(`frame/catalog?limit=100`).then(r => r.frames);
42 return await fetchNeynarGetPages(`frame/catalog?limit=100`, 4, "frames").then(r => r.frames);
43 });
44

perplexityAPImain.tsx2 matches

@nbbaier•Updated 3 weeks ago
1import { PplxRequest, PplxResponse } from "https://esm.town/v/nbbaier/perplexityAPI/pplxTypes.ts";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export const pplx = async (options: PplxRequest & { apiKey?: string }): Promise<PplxResponse> => {
5 const token = options.apiKey ? options.apiKey : Deno.env.get("PERPLEXITY_API_KEY");
6 return await fetchJSON("https://api.perplexity.ai/chat/completions", {
7 method: "POST",
8 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago