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=328&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 8300 results for "fetch"(758ms)

socialDataSearch_910575socialDataSearch2 matches

@charmaine•Updated 1 month ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function socialDataSearch(query: string): Promise<SocialDataResponse> {
4 const url = new URL("https://stevekrouse-socialdataproxy.web.val.run/twitter/search");
5 url.searchParams.set("query", query);
6 return await fetchJSON(url.toString(), {
7 bearer: Deno.env.get("valtown"),
8 });

wikimain.tsx5 matches

@yawnxyz•Updated 1 month ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchFromWikipedia(params) {
4 const endpoint = 'https://en.wikipedia.org/w/api.php';
5 const url = `${endpoint}?${new URLSearchParams(params).toString()}`;
6
7 try {
8 const response = await fetch(url);
9 const data = await response.json();
10 return data;
11 } catch (error) {
12 console.error('Error fetching Wikipedia data:', error);
13 }
14}
23
24 const params = { ...defaultParams, ...additionalParams };
25 const data = await fetchFromWikipedia(params);
26
27 // Construct full URLs for each search result

summarizeFeedbinEntriesmain.tsx1 match

@kamalnrf•Updated 1 month ago
59
60async function feedbinUnreadEntries() {
61 const { result } = await (await fetch("https://kamalnrf-feedbinunreads.web.val.run")).json();
62 return result ?? [];
63}

GitHubSyncREADME.md4 matches

@tallesjp•Updated 1 month ago
12
13- `/push` will copy the contents from a list of vals specified in `config.json` and push them to a GitHub repo
14- `/deploy` is a GitHub webhook URL that will fetch contents from GitHub and update the code on Val Town
15
161. Fork this val
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
28
29### Example push to GitHub fetch
30
31You can use this example to POST to the `/push` endpoint to copy vals to GitHub.
46 const signature = await sign(body, secret);
47
48 const res = await fetch(url, {
49 method: "POST",
50 body,
89- [x] Monkey test
90- [x] Add setup instructions to readme
91- [x] Add example code for private webhook fetch
92- [x] Make val and repo public
93- [ ] Check modified date before export to GitHub??

GitHubSyncindex1 match

@tallesjp•Updated 1 month ago
22app.post("/deploy", verifyGitHubSignature(GITHUB_WEBHOOK_SECRET), deploy);
23
24export default app.fetch;
island

islandapp.tsx1 match

@maxm•Updated 1 month ago
53 const handleClick = async (row, col) => {
54 try {
55 const response = await fetch("/api/board", {
56 method: "POST",
57 headers: {

CyberMetaxmain.tsx1 match

@CyberK14•Updated 1 month ago
275 const handleDownload = async (file) => {
276 try {
277 const response = await fetch(`/download?filename=${encodeURIComponent(file.name)}`, {
278 method: "GET",
279 });

mandomain.tsx4 matches

@api•Updated 1 month ago
92
93 // Send request for processing
94 const response = await fetch("/process", {
95 method: "POST",
96 headers: {
130 if (data.actionType === "use_tool" && data.tool) {
131 try {
132 const toolResponse = await fetch("/tool", {
133 method: "POST",
134 headers: {
155 // Get the other agent's analysis of the tool response
156 const otherAgent = activeAgent === "maverick" ? "oracle" : "maverick";
157 const analysisResponse = await fetch("/analyze", {
158 method: "POST",
159 headers: {
602 A user has requested information about: "${topic}"
603
604 Define a schema for this information topic and create a direct, action-oriented query to fetch detailed data.
605 Be decisive and focus on fast, effective results.
606
cerebras_coder

cerebras_coderindex1 match

@Proking2005•Updated 1 month ago
5async function servePublicFile(path: string): Promise<Response> {
6 const url = new URL("./public/" + path, import.meta.url);
7 const text = await (await fetch(url, {
8 headers: {
9 "User-Agent": "", // to transpile TS to JS
cerebras_coder

cerebras_coderindex1 match

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

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago