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/$%7Burl%7D?q=fetch&page=41&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 8540 results for "fetch"(996ms)

139 const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
140
141 const response = await fetch(url, {
142 method: "PATCH",
143 headers: {
77 console.log("Current PR labels:", currentLabels);
78
79 // Fetch labels from all linked issues
80 const repo = payload.repository.full_name;
81 let allIssueLabels: string[] = [];
82
83 for (const issueNumber of issueNumbers) {
84 console.log(`Fetching labels for issue #${issueNumber}`);
85 try {
86 const issue = await fetchIssue(repo, issueNumber);
87 const issueLabels = issue.labels.map(label => label.name);
88 console.log(`Labels for issue #${issueNumber}:`, issueLabels);
95 }
96 } catch (error) {
97 console.error(`Error fetching issue #${issueNumber}:`, error);
98 }
99 }
154}
155
156// Fetch issue details
157async function fetchIssue(repo: string, issueNumber: number): Promise<GitHubIssue> {
158 const token = Deno.env.get("GITHUB_TOKEN");
159
164 const url = `https://api.github.com/repos/${repo}/issues/${issueNumber}`;
165
166 const response = await fetch(url, {
167 headers: {
168 "Authorization": `token ${token}`,
180 // If we can't parse the error as JSON, use the status text
181 }
182 throw new Error(`Failed to fetch issue: ${errorMessage}`);
183 }
184
197 const url = `https://api.github.com/repos/${repo}/issues/${prNumber}/labels`;
198
199 const response = await fetch(url, {
200 method: "POST",
201 headers: {
101 const url = `https://api.github.com/repos/${repo}/issues/${prNumber}/assignees`;
102
103 const response = await fetch(url, {
104 method: "POST",
105 headers: {

NowPlayingGrabbermain.tsx2 matches

@thunder75•Updated 6 days ago
12 const basic = Buffer.from(`${client_id}:${client_secret}`).toString("base64");
13
14 const response = await fetch(TOKEN_ENDPOINT, {
15 method: "POST",
16 headers: {
31 const { access_token } = await getAccessToken(client_id, client_secret, refresh_token);
32
33 const response = await fetch(NOW_PLAYING_ENDPOINT, {
34 headers: {
35 Authorization: `Bearer ${access_token}`,

instagram-toolsfollows-check.jsx4 matches

@julianpera•Updated 1 week ago
1import makeFetchCookie from "npm:fetch-cookie";
2const fetchCookie = makeFetchCookie(fetch);
3
4export default async function handleCron(interval) {
5 const following = await fetchCookie(
6 "https://www.instagram.com/api/v1/friendships/375942300/following/?query=miguelse10",
7 {
16 const isFollowing = following.users.some((user) => user.username === "miguelse10");
17
18 const pushNotification = await fetchCookie(
19 "https://ntfy.sh/alEMfLpdpoXMe6jB",
20 {

NowPlayingGrabbermain.tsx2 matches

@anthropium•Updated 1 week ago
12 const basic = Buffer.from(`${client_id}:${client_secret}`).toString("base64");
13
14 const response = await fetch(TOKEN_ENDPOINT, {
15 method: "POST",
16 headers: {
31 const { access_token } = await getAccessToken(client_id, client_secret, refresh_token);
32
33 const response = await fetch(NOW_PLAYING_ENDPOINT, {
34 headers: {
35 Authorization: `Bearer ${access_token}`,

telegramBotStartersetupHook.tsx2 matches

@asdfg•Updated 1 week ago
11 try {
12 const botToken = process.env.TELEGRAM_BOT_TOKEN;
13 const response = await fetch(`https://api.telegram.org/bot${botToken}/setWebhook`, {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },
37 const botToken = process.env.TELEGRAM_BOT_TOKEN;
38
39 const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
40 const result = await response.json();
41 return result;

turbo-testmain.tsx1 match

@msmh•Updated 1 week ago
422for (const url of urls) {
423 try {
424 const response = await fetch(url);
425 const json = await response.json();
426 if (json) {

cerebras_coderindex.ts1 match

@Webmaker•Updated 1 week ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

steamforumscannermain.tsx4 matches

@luoyuchu•Updated 1 week ago
60 try {
61 await cleanupDebugHtmlBlobs(gameName);
62 const html = await fetchSteamDiscussionsPage(steamUrl);
63 await saveDebugHtml(gameName, html);
64
115}
116
117async function fetchSteamDiscussionsPage(url: string): Promise<string> {
118 const response = await fetch(url, {
119 headers: {
120 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
333 console.log("Discord Webhook Payload:", JSON.stringify(payload, null, 2));
334
335 const response = await fetch(webhookUrl, {
336 method: "POST",
337 headers: { "Content-Type": "application/json" },

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago