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=646&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 7669 results for "fetch"(3068ms)

untitled_pinkRoundwormmain.tsx1 match

@stevekrouse•Updated 1 year ago
22 return c.json({ message: "Comment added!" });
23});
24export default app.fetch;

untitled_tanHaremain.tsx1 match

@vez•Updated 1 year ago
11app.get("/edit/:blob", async (c) => c.html(`TODO: Edit ${c.req.param("blob")}`));
12app.get("/delete/:blob", async (c) => c.html(`TODO: Delete ${c.req.param("blob")}`));
13export default basicAuth(app.fetch);

commentsREADME.md2 matches

@vez•Updated 1 year ago
7
8const getComments = async () => {
9 const response = await fetch(MY_FORKED_VAL_URL);
10 const json = await response.json();
11 return json;
14const addComment = async (str) => {
15 try {
16 const response = await fetch(MY_FORKED_VAL_URL, {
17 method: "POST",
18 body: JSON.stringify(str),

browserlessScrapeExamplemain.tsx2 matches

@fab1an•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import process from "node:process";
3
4export const browserlessScrapeExample = (async () => {
5 const res = await fetchJSON(
6 `https://chrome.browserless.io/scrape?token=${process.env.browserlessKey}`,
7 {

checkHfsmain.tsx2 matches

@rejetto•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2export async function checkHfs(url: string) {
3 const res = await (await fetch(url)).text();
4 return res.includes("HFS");
5}

dailyDadJokemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

getDadJokemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let getDadJoke = () => fetchJSON("https://official-joke-api.appspot.com/random_joke");

untitled_aquaQuailmain.tsx2 matches

@liflovs•Updated 1 year ago
13
14async function execute(statement: InStatement): Promise<ResultSet> {
15 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
16 method: "POST",
17 headers: {
27
28async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
29 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
30 method: "POST",
31 headers: {

databinREADME.md1 match

@jamiedubs•Updated 1 year ago
1a super simple JSON setter/getter using valtown blobs. use GET to fetch it, use POST to set it. expects the inbound data to be JSON for simplicity. use `?key=foobar` to specify different storage locations.
2
3set:

gsheet_callmain.tsx2 matches

@mattx•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago