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=807&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 8299 results for "fetch"(3735ms)

blogRSSREADME.md3 matches

@stevekrouse•Updated 1 year ago
7## Architecture
8
91. Fetch and parse the HTML of https://blog.val.town – @stevekrouse.valTownBlogJSON.
102. Create an RSS string out of that array of blog objects – @stevekrouse.valTownBlogRSS.
113. Expose [an endpoint that returns that RSS](https://stevekrouse-blogRSS.web.val.run), with appropriate content-type and cache headers – this val, @stevekrouse.blogRSS
13## Notes
14
15* This is very inefficient. It refetches and re-parses blog.val.town on every single request, modulo some caching via the headers. It would be much more efficient to cache the results of fetching and parsing the Val Town blog, and then only re-fetch it every 10 minutes or so.
16* Instead of fetching and parsing HTML from super.so, we could get this same data from Notion's API, with a val like @stevekrouse.notionGetDatabase.
17
18Migrated from folder: Archive/blogRSS

fetchAndParseXMLREADME.md1 match

@mgruel•Updated 1 year ago
1Migrated from folder: common/fetchAndParseXML

fetchTextREADME.md1 match

@mgruel•Updated 1 year ago
1Migrated from folder: common/fetchText

twitterREADME.md1 match

@andreterron•Updated 1 year ago
15
16- Refresh your tokens: https://www.val.town/v/andreterron/refreshTwitterToken
17- Fetch user by id: https://www.val.town/v/andreterron/fetchTwitterUser
18- Search posts: https://www.val.town/v/andreterron/searchTweets
19- Write an X post: https://www.val.town/v/andreterron/postTweet

fetchTwitterUserREADME.md1 match

@andreterron•Updated 1 year ago
1Migrated from folder: A_Make_A_Val_Day/_23_08_17_Actually_Its_X/Twitter_Helpers/fetchTwitterUser

fetchJSONREADME.md1 match

@mgruel•Updated 1 year ago
1Migrated from folder: common/fetchJSON

reasonPhraseREADME.md3 matches

@tmcw•Updated 1 year ago
11_None of this information is useful. The reason-phrase is barely supported on the web and was always an oddity, but keep reading if you like oddities!_
12
13If you're used to JavaScript’s `fetch()` method to make HTTP requests, you've seen the `reason-phrase` under a different name: `statusText`:
14
15```ts
16(await fetch('https://example.com/')).statusText
17```
18
48```
49
50Unfortunately, this doesn't work! The response that Val Town produces is reorganized and optimized by Cloudflare, which upgrades requests and responses from HTTP 1.1 to HTTP 2. And sadly, HTTP 2 [dropped support for the custom reason-phrase](https://fetch.spec.whatwg.org/#concept-response-status-message).
51
52_RIP the `reason-phrase`._ It was present even in a [1992 draft of the HTTP specification](https://www.w3.org/Protocols/HTTP/Response.html), and was a weird and under-appreciated way to pilfer extra information in a response. Now, thanks to HTTP/2 and the commonplace use of proxies and CDNs like Cloudflare, it's no longer usable. It was fun while it lasted.

getCommentsREADME.md1 match

@neverstew•Updated 1 year ago
1# GET /v1/me/comments
2Fetches information about any comments on vals.
3
4Requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.

getLikesREADME.md1 match

@neverstew•Updated 1 year ago
1# GET /v1/me/likes
2Fetches information about any val you "like".
3
4Requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.

duckdbExampleREADME.md1 match

@tmcw•Updated 1 year ago
1# DuckDB
2
3[DuckDB](https://duckdb.org/) works on Val Town, with only one small tweak! We're basically using DuckDB in the same way you'd use it with a browser - using the WASM package with its dependencies fetched from [jsdelivr](https://www.jsdelivr.com/).
4
5The only trick is to create the worker ourselves rather than using `duckdb.createWorker`. DuckDB's built-in createWorker method doesn't specify a worker type, which causes `type` to default to `classic`, and Deno (our runtime) doesn't support classic workers.

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago