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=407&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 6156 results for "fetch"(1134ms)

basemain.tsx1 match

@temptemp•Updated 6 months ago
1import CryptoJS from "npm:crypto-js";
2const regex = /case (0[xX][\da-fA-F]+):([a-zA-Z\d]+)=(.),([a-zA-Z\d]+)=(.)/gm;
3const req = await fetch("https://southcloud.tv/js/player/a/sc/prod/p1-debug.min.js");
4const str = await req.text();
5let m;

welcomingSapphireRoundwormmain.tsx3 matches

@stevekrouse•Updated 6 months ago
21 try {
22 // First API call - Get search results
23 const searchResult = await fetch("/api/search", {
24 method: "POST",
25 headers: { "Content-Type": "application/json" },
32 // Second API call - Get summary
33 setSummaryLoading(true);
34 const summaryResult = await fetch("/api/summarize", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },
125
126 // Search using SerpApi
127 const searchResponse = await fetch(
128 `https://serpapi.com/search.json?q=${encodeURIComponent(query)}&api_key=${Deno.env.get("SERP_API_KEY")}`,
129 );

what_did_i_work_on_todaymain.tsx14 matches

@danphilibin•Updated 6 months ago
10const DEMO_MODE = true;
11
12// Time window for fetching activity
13const HOURS_TO_FETCH = 30;
14
15// GitHub Settings
90 <h2>{type}</h2>
91 {items.length === 0
92 ? <p>No {type.toLowerCase()} found in the last {HOURS_TO_FETCH} hours</p>
93 : (
94 <ul className="list">
119 useEffect(() => {
120 Promise.all([
121 fetch("/api/prs").then(async (res) => {
122 if (!res.ok) {
123 const error = await res.json();
124 throw new Error(error.message || "Failed to fetch PRs");
125 }
126 return res.json();
127 }),
128 fetch("/api/issues").then(async (res) => {
129 if (!res.ok) {
130 const error = await res.json();
131 throw new Error(error.message || "Failed to fetch issues");
132 }
133 return res.json();
197 }
198
199 const timeAgo = new Date(Date.now() - (HOURS_TO_FETCH * MILLISECONDS_PER_HOUR)).toISOString();
200
201 const response = await fetch(
202 `https://api.github.com/search/issues?q=repo:${GITHUB.REPOSITORY}+author:${GITHUB.USERNAME}+created:>${timeAgo}+type:pr`,
203 {
205 "Accept": "application/vnd.github.v3+json",
206 "Authorization": `Bearer ${githubToken}`,
207 "User-Agent": "Val-Town-PR-Fetcher",
208 },
209 },
212 if (!response.ok) {
213 const error = await response.json();
214 return createErrorResponse(error.message || "Failed to fetch from GitHub", response.status);
215 }
216
231 }
232
233 const timeAgo = new Date(Date.now() - (HOURS_TO_FETCH * MILLISECONDS_PER_HOUR)).toISOString();
234
235 const query = `
252 `;
253
254 const response = await fetch("https://api.linear.app/graphql", {
255 method: "POST",
256 headers: {
263 if (!response.ok) {
264 const error = await response.json();
265 return createErrorResponse(error.message || "Failed to fetch from Linear", response.status);
266 }
267

passwordgamemain.tsx1 match

@stevekrouse•Updated 6 months ago
54 setLoading(true);
55 try {
56 const response = await fetch("/", {
57 method: "POST",
58 body: JSON.stringify({ level, password, requirements }),

passwordgamemain.tsx1 match

@stevekrouse•Updated 6 months ago
54 setLoading(true);
55 try {
56 const response = await fetch("/", {
57 method: "POST",
58 body: JSON.stringify({ level, password, requirements }),

skilledCoffeePanthermain.tsx2 matches

@gigmx•Updated 6 months ago
95
96 // Test API connection
97 fetch(API_URL + "/")
98 .then(response => {
99 if (!response.ok) throw new Error();
138
139 try {
140 const response = await fetch(API_URL + "/message", {
141 method: "POST",
142 headers: {

findSlamArticlesmain.tsx1 match

@dupontgu•Updated 6 months ago
24
25 try {
26 const response = await fetch(targetUrl);
27 const html = await response.text();
28 const $ = cheerio.load(html);

slackReplyToMessagemain.tsx4 matches

@nicot•Updated 6 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const slackReplyToMessage = async (req: Request) => {
16 // Reply to app_mention events
17 if (body.event.type === "app_mention") {
18 const usersResponse = await fetchJSON(
19 `https://slack.com/api/usergroups.users.list?usergroup=S07S1056LN6`,
20 {
28 // Ensure the response was successful and contains users
29 if (!usersResponse.ok || !usersResponse.users || usersResponse.users.length === 0) {
30 console.error("Failed to fetch users or no users found");
31 return new Response(undefined, { status: 500 });
32 }
37
38 // Send a message mentioning the randomly selected user
39 const result = await fetchJSON(
40 "https://slack.com/api/chat.postMessage",
41 {

kalshimain.tsx5 matches

@lucaskohorst•Updated 6 months ago
42 let currentSort = { key: 'daily_volume', direction: 'desc' };
43
44 async function fetchData() {
45 try {
46 const response = await fetch('https://kalshi-public-docs.s3.amazonaws.com/reporting/market_data_2024-10-22.json');
47 const data = await response.json();
48 tableData = Array.isArray(data) ? data : [data]; // Handle single object or array
50 renderTable();
51 } catch (error) {
52 console.error('Error fetching data:', error);
53 }
54 }
115 });
116
117 // Initial fetch
118 fetchData();
119 </script>
120 </body>

unpaywallmain.tsx4 matches

@yawnxyz•Updated 6 months ago
1import { Hono } from "npm:hono@3";
2import { cors } from "npm:hono/cors";
3import { fetch } from "https://esm.town/v/std/fetch";
4
5const app = new Hono();
19
20 try {
21 const response = await fetch(url, options);
22 if (!response.ok) {
23 throw new Error(`HTTP error! status: ${response.status}`);
53
54 console.log('search url:', url)
55 const response = await fetch(url, options);
56 if (!response.ok) {
57 throw new Error(`HTTP error! status: ${response.status}`);
111});
112
113export default app.fetch;
114export { unpaywallDOI, unpaywallSearch };

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago