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=133&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 18940 results for "fetch"(1340ms)

32
33async function checkStargazers(repo: string) {
34 console.log(`Fetching repo data for ${repo}`);
35 const response = await fetch(`https://api.github.com/repos/${repo}`, {
36 headers: { "Authorization": `Bearer ${Deno.env.get("GITHUB_TOKEN")}` }
37 });
66
67 const lastPage = Math.ceil(currentStars / 100);
68 console.log(`Fetching stargazers page ${lastPage}`);
69 const starResponse = await fetch(
70 `https://api.github.com/repos/${repo}/stargazers?per_page=100&page=${lastPage}`,
71 {
83 console.log(`Retrieved ${newStargazers.length} new stargazers`);
84 } else {
85 console.error(`Failed to fetch stargazers: ${starResponse.status}`);
86 }
87

enrich-github-stargazersslack.ts1 match

@jnakaita•Updated 3 weeks ago
21 }
22
23 await fetch(slackUrl, {
24 method: "POST",
25 headers: { "Content-Type": "application/json" },

enrich-github-stargazersREADME.md1 match

@jnakaita•Updated 3 weeks ago
21- **REPOS** (line 8-12): List of repositories to monitor
22- Environment variables needed:
23 - `GITHUB_TOKEN`: GitHub API token for fetching stargazer data
24 - `SLACK_WEBHOOK_URL`: Slack webhook for notifications (optional)

utilprowl.tsx2 matches

@jrmann100•Updated 3 weeks ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
31 description?: string;
32}) =>
33 await fetch(`https://api.prowlapp.com/publicapi/add?${
34 new URLSearchParams({
35 apikey: process.env.prowl,

simple-path-to-godmain.tsx5 matches

@shaunlebron•Updated 3 weeks ago
4const feedUrl = 'https://feeds.ancientfaith.com/simplepath';
5
6async function fetchRssItems(url) {
7 const req = await fetch(url);
8 const text = await req.text();
9 var result = JSON.parse(xml2json(text, {compact: true, spaces: 4}));
11}
12
13async function fetchEpisodes() {
14 const items = await fetchRssItems(feedUrl);
15 items.reverse();
16 return items.map((item, idx) => {
52 const {pathname} = new URL(req.url);
53 const response = (text,type) => new Response(text, { headers: { "Content-Type": type }});
54 const page = renderPage(await fetchEpisodes());
55 return (
56 pathname == "/" ? response(page, "text/html") :

clinkmain.tsx1 match

@jrmann100•Updated 3 weeks ago
447});
448
449export default app.fetch;

pushpushFrontend.js3 matches

@jrmann100•Updated 3 weeks ago
13 }
14 let clientSubscription = await registration.pushManager.getSubscription();
15 let serverSubscription = await (await fetch("/subscription")).json();
16
17 if (clientSubscription === null) {
47 button.disabled = true;
48 button.textContent = await (
49 await fetch("/subscription", {
50 method: "PUT",
51 body: JSON.stringify(
55 userVisibleOnly: true,
56 applicationServerKey: await (
57 await fetch("/vapidPublicKey")
58 ).text(),
59 }),

dartmouthCoursesqueryTimetable.tsx4 matches

@jrmann100•Updated 3 weeks ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseCourses } from "./parseCourses.tsx";
3
7][];
8export const queryTimetable = (path: string, params: Params) => {
9 const fetchTimetable = (path: string, params: Params) =>
10 fetch(`https://oracle-www.dartmouth.edu/dart/groucho/timetable.${path}`, {
11 headers: {
12 accept: "text/html",
20 ? Promise.resolve(resp)
21 : Promise.reject(resp.statusText);
22 return fetchTimetable(path, params)
23 .then(throwBadResponse)
24 .then((resp) => resp.text())

modern-monacossr.tsx1 match

@ije•Updated 3 weeks ago
31
32export default async (req: Request): Promise<Response> => {
33 const code = await fetch(RAW_SOURCE).then((r) => r.text());
34 const theme = THEMES[Math.floor(Math.random() * THEMES.length)];
35 const userAgent = req.headers.get("user-agent");

coursePushcoursePushServer.tsx1 match

@jrmann100•Updated 3 weeks ago
48 return c.text("Sent notification!", 201);
49 });
50 return app.fetch(req);
51 } catch (f) {
52 console.error(f.toString() + "\n" + f.stack);

FetchBasic2 file matches

@bengold•Updated 1 week ago

fetch1 file match

@raify•Updated 2 weeks ago