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=235&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 2374 results for "fetch"(255ms)

valreadmegeneratormain.tsx1 match

@prashamtrivedi•Updated 4 months ago
42
43 try {
44 const response = await fetch(`/generate-readme/${user}/${val}`);
45
46 if (!response.ok) {

valreadmegeneratorREADME.md2 matches

@prashamtrivedi•Updated 4 months ago
29
302. **Generate:**
31 - Click on 'Generate README' and watch as the application swiftly fetches and processes the Val code to create a Markdown README.
32
333. **Copy and Share:**
42- **TailwindCSS:** For styling the application.
43- **Deno:** The server-side environment.
44- **ValTown SDK:** Integrated to fetch Val details.
45- **OpenAI GPT-4:** To generate natural language README content.
46- **JavaScript Modules (ESM):** For seamless module imports.

yc_findermain.tsx5 matches

@stevekrouse•Updated 5 months ago
62
63 useEffect(() => {
64 const fetchYCCompanies = async () => {
65 const storedCompanies = localStorage.getItem("ycCompanies");
66 if (storedCompanies) {
69 setDebugInfo(prevInfo => prevInfo + `\nLoaded ${companies.length} companies from localStorage`);
70 } else {
71 const response = await fetch("/companies.json");
72 const companies = await response.json();
73 setYcCompanies(companies);
74 localStorage.setItem("ycCompanies", JSON.stringify(companies));
75 setDebugInfo(prevInfo =>
76 prevInfo + `\nFetched ${companies.length} companies from server and stored in localStorage`
77 );
78 }
79 };
80 fetchYCCompanies();
81 }, []);
82
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);
230 if (url.pathname === "/companies.json") {

XKCDComicOfTheDaymain.tsx3 matches

@wolf•Updated 7 months ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
2import { load } from "npm:cheerio";
3
4export default async function(req: Request): Promise<Response> {
5 const response = await fetchText("https://xkcd.com/");
6 const $ = load(response);
7 const image = $("div#comic img").attr("src");
8 return new Response(await (await fetch(image)).arrayBuffer());
9}

cronJobToCheckCISAKEVmain.tsx1 match

@hrbrmstr•Updated 7 months ago
6
7async function checkNewVulnerabilities() {
8 const response = await fetch(KEV_URL);
9 const data = await response.json();
10 const currentVulnerabilities = new Set(data.vulnerabilities.map(v => v.cveID));

knownExploitedVulnsEndpointmain.tsx2 matches

@hrbrmstr•Updated 7 months ago
1export default async function server(request: Request): Promise<Response> {
2 try {
3 const response = await fetch("https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json");
4 if (!response.ok) {
5 throw new Error(`HTTP error! status: ${response.status}`);
23 } catch (error) {
24 console.error("Error:", error);
25 return new Response(JSON.stringify({ error: "Failed to fetch or process vulnerabilities data" }), {
26 status: 500,
27 headers: {

cisaKEVToRSSmain.tsx2 matches

@hrbrmstr•Updated 7 months ago
70export async function handler(req: Request): Promise<Response> {
71 try {
72 const response = await fetch(CISA_JSON_URL);
73
74 if (!response.ok) {
75 throw new Error(`Failed to fetch data: ${response.status} ${response.statusText}`);
76 }
77

emailmain.tsx1 match

@shouser•Updated 8 months ago
68 headers?: Record<string, string>;
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {

cronLoggermain.tsx2 matches

@nbbaier•Updated 9 months ago
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=45";
5import { refs } from "https://esm.town/v/stevekrouse/refs?v=11";
6
26 headers["Authorization"] = `Bearer ${token}`;
27 }
28 const { id } = await fetchJSON(`${API_URL}/v1/alias/${userHandle}/${valName}`, { headers });
29
30 const table_name = "cron_evals";

frequencyDotPlotmain.tsx1 match

@stevekrouse•Updated 1 year ago
23});
24
25export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 3 days ago

tweetFetcher2 file matches

@nbbaier•Updated 6 days ago