Back to APIs list

Github API examples & templates

Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
pomdtr avatar
sqliteExplorerApp
@pomdtr
HTTP (deprecated)
Forked from nbbaier/sqliteExplorerApp
stevekrouse avatar
whiteXerinae
@stevekrouse
HTTP (deprecated)
Forked from nbbaier/sqliteExplorerApp
tmcw avatar
maroonSawfish
@tmcw
Script
An interactive, runnable TypeScript val by tmcw
fil avatar
earthquakes
@fil
HTTP
Earthquake map 🌏 This val loads earthquake data from USGS, a topojson file for the land shape, and supporting libraries. It then creates a map and save it as a SVG string. The result is cached for a day. Note that we must strive to keep it under val.town’s limit of 100kB, hence the heavy simplification of the land shape. (For a simpler example, see becker barley .) | | | |-----|-----| | Web page | https://fil-earthquakes.web.val.run/ | | Observable Plot | https://observablehq.com/plot/ | | linkedom | https://github.com/WebReflection/linkedom | | topojson | https://github.com/topojson/topojson | | earthquakes | https://earthquake.usgs.gov | | world | https://observablehq.com/@visionscarto/world-atlas-topojson | | css | https://milligram.io/ |
todimech avatar
sqliteExplorerApp
@todimech
HTTP (deprecated)
Forked from nbbaier/sqliteExplorerApp
davidpadbury avatar
dailyDadJoke
@davidpadbury
Cron
Forked from stevekrouse/dailyDadJoke
samwho avatar
sqliteExplorerApp
@samwho
HTTP (deprecated)
Forked from nbbaier/sqliteExplorerApp
yieldray avatar
minhtml
@yieldray
HTTP (deprecated)
An interactive, runnable TypeScript val by yieldray
maxm avatar
tinygoHttpExample
@maxm
HTTP (deprecated)
A Go http handler running in Val Town: The Go source is here . Mandelbrot rendering code taken from here . I used maxm/compileAndUploadTinygoWasm to compile the code and create the val. $ git clone git@github.com:maxmcd/go-town.git $ cd go-town/val-town-tinygo-http-example $ deno run --allow-net --allow-run --allow-read "https://esm.town/v/maxm/compileAndUploadTinygoWasm?v=58" Running tinygo build -o main.wasm -target=wasi . Compliation complete Running wasm-strip main.wasm Copy the following into a val town HTTP val: import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp"; const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm"); const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer())); export default async function(req: Request): Promise<Response> { return handler(req); }
mmorihara avatar
bloodyOliveMollusk
@mmorihara
Script
WIP SQLite graph database based on https://github.com/dpapathanasiou/simple-graph
maxm avatar
compileAndUploadTinygoWasm
@maxm
Script
Compile and Upload Tinygo WASM to Val Town Using Deno Make a Go program like so: package main import ( "fmt" "net/http" gotown "github.com/maxmcd/go-town" ) func main() { gotown.ListenAndServe(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") })) } Make sure you have tinygo (and optionally wasm-strip) installed. Then run this command with Deno to invoke this script: deno run --allow-net --allow-run --allow-read \ "https://esm.town/v/maxm/compileAndUploadTinygoWasm?v=58" That will print out the following: Running tinygo build -o main.wasm -target=wasi . Compliation complete Running wasm-strip main.wasm Copy the following into a val town HTTP val: import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp"; const resp = await fetch("https://maxm-wasmBlobHost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm"); const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer())); export default async function(req: Request): Promise<Response> { return handler(req); } Copy that into a Val and you have a working Go http handler! View that example here: https://www.val.town/v/maxm/crimsonMacaw
yieldray avatar
minifyHTML
@yieldray
Script
Usage: import { minifyHTML } from "https://esm.town/v/yieldray/minifyHTML"; const minified = await minifyHTML("<html>...</html>", { ...options }); As an API: import { runVal } from "https://esm.town/v/std/runVal"; const minified = awaitrunVal("yieldray.minifyHTML", "<html>...</html>", { ...options });
pomdtr avatar
tree_example
@pomdtr
HTTP (deprecated)
View Example View Extension Repository #example
stevekrouse avatar
dateMeDocs
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
adrianmg avatar
sqliteExplorerApp
@adrianmg
HTTP (deprecated)
Forked from nbbaier/sqliteExplorerApp
vladimyr avatar
jwkToDidKey_tests
@vladimyr
Script
// @see: https://w3c-ccg.github.io/did-method-key/#example-5
…
26
…
Next