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=fetch&page=1236&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 13573 results for "fetch"(5294ms)

getDevToPublicPostsmain.tsx1 match

@xkonti•Updated 1 year ago
1export const getDevToPublicPosts = async (username: string) => {
2 let data = await fetch(`https://dev.to/api/articles?username=${username}`);
3 return await data.json();
4};

fetchPinatsPostsmain.tsx4 matches

@stevedylandev•Updated 1 year ago
2let endDate = Math.floor(currentDate.getTime() / 1000);
3let startDate = Math.floor(currentDate.setDate(currentDate.getDate() - 7) / 1000);
4export async function fetchPinataPosts() {
5 try {
6 const soRes = await fetch(
7 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=pinata&site=stackoverflow`,
8 {
23 });
24
25 const seRes = await fetch(
26 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=pinata&site=ethereum`,
27 {
62 return emailText;
63 } catch (error) {
64 console.error("Error fetching data:", error);
65 return null;
66 }

honoExamplemain.tsx1 match

@tmcw•Updated 1 year ago
4app.get("/", (c) => c.text("Hello world!"));
5app.get("/yeah", (c) => c.text("Routing!"));
6export default app.fetch;

crux_addmain.tsx1 match

@yieldray•Updated 1 year ago
1export async function crux_add(name: string, content: string) {
2 const res = await fetch("https://crux.land/api/add", {
3 method: "POST",
4 headers: { "content-type": "application/json" },

checkIosBingAppsmain.tsx2 matches

@cescyang_service•Updated 1 year ago
1import { rule } from "https://esm.town/v/cescyang_service/rule";
2import { email } from "https://esm.town/v/std/email?v=9";
3import { fetch } from "https://esm.town/v/std/fetch";
4
5export async function checkAndroidBingApps() {
8 "https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
9 try {
10 const response = await fetch(url, {
11 method: "GET",
12 });

checkAndroidBingAppsmain.tsx2 matches

@cescyang_service•Updated 1 year ago
1import { rule } from "https://esm.town/v/cescyang_service/rule";
2import { email } from "https://esm.town/v/std/email?v=9";
3import { fetch } from "https://esm.town/v/std/fetch";
4
5export async function checkAndroidBingApps() {
8 "https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
9 try {
10 const response = await fetch(url, {
11 method: "GET",
12 });

untitled_emeraldChinchillamain.tsx4 matches

@tejchak•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

getReplicatePredictionmain.tsx2 matches

@patrickjm•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3/**
18 throw new Error("missing predictionId");
19 }
20 const result = await fetchJSON(
21 `https://api.replicate.com/v1/predictions/${encodeURIComponent(predictionId)}`,
22 {

untitled_silverFowlmain.tsx4 matches

@rmahshie50•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

subarumain.tsx6 matches

@seep•Updated 1 year ago
2import process from "node:process";
3
4const { wrapFetch: FetchWithCookie } = await import("https://deno.land/x/another_cookiejar@v5.0.3/mod.ts");
5
6const fetch = FetchWithCookie();
7
8type ServiceResponse = { id: string; success: boolean };
17
18 const dest = "https://www.mysubaru.com/login";
19 const resp = await fetch(dest, { method: "POST", body });
20
21 assert(resp.status == 200, `unexpected login response status: ${resp.status}`);
28
29 const url = "https://www.mysubaru.com/service/g2/remoteService/status.json";
30 const res = await fetch(url, { method: "POST", body });
31
32 return await parseServiceResponse(res);
58
59 const url = "https://www.mysubaru.com/service/g2/engineStart/execute.json";
60 const res = await fetch(url, { method: "POST", body: new URLSearchParams(opts) });
61
62 return await parseServiceResponse(res);
73
74 const url = "https://www.mysubaru.com/service/g2/engineStop/execute.json";
75 const res = await fetch(url, { method: "POST", body: new URLSearchParams(opts) });
76
77 return await parseServiceResponse(res);

FetchBasic2 file matches

@ther•Updated 1 hour ago

GithubPRFetcher

@andybak•Updated 3 days ago