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.
willthereader avatar
personalWebsite
@willthereader
http
@jsxImportSource https://esm.sh/hono@latest/jsx
willthereader avatar
honoExample
@willthereader
http
@jsxImportSource https://esm.sh/hono@latest/jsx
tfayyaz avatar
tahirsTil
@tfayyaz
http
Inspiration for having a blog and TIL/read taken from https://simonwillison.net/ https://bradfrost.com/blog/ https://geoffgraham.me/blog/ https://matthewstrom.com/ To-do: Buy tahirfayyaz.dev domain from iwantmyname.com Use SQLlite to store all the posts Create an editor to post to SQLlite maybe with live preview? Update site to use HTMX Active Search - https://htmx.org/examples/active-search/
ayush37 avatar
forwarder
@ayush37
email
Unlimited Anonymous Emails Create anonymous emails and forward their results to your inbox.
maxm avatar
repp
@maxm
http
repp
avkv avatar
staticChess
@avkv
http
Static Chess Check it out here: https://chess.maxmcd.com Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves? Functionality is quite limited, and things might be broken. Please let me know if you find bugs! Inspired by this HN discussion about sites that have all possible game states of tic-tac-toe. I plan on extending this to support real gameplay. I think it could be a nice simple interface for long form games with friends. Might also be fun to add a static AI to play against. Feel free to PR any changes if you'd like to see something added.
maxm avatar
staticChessV2
@maxm
http
@jsxImportSource https://esm.sh/react
maxm avatar
staticChess
@maxm
http
Static Chess Check it out here: https://chess.maxmcd.com Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves? Functionality is quite limited, and things might be broken. Please let me know if you find bugs! Inspired by this HN discussion about sites that have all possible game states of tic-tac-toe. I plan on extending this to support real gameplay. I think it could be a nice simple interface for long form games with friends. Might also be fun to add a static AI to play against. Feel free to PR any changes if you'd like to see something added.
curtcox avatar
markdown_download
@curtcox
http
markdown.download Handy microservice/library to convert various data sources into markdown. Intended to make it easier to consume the web in ereaders Introductory blog post: https://taras.glek.net/post/markdown.download/ Package: https://jsr.io/@tarasglek/markdown-download Features Apply readability Further convert article into markdown to simplify it Allow webpages to be viewable as markdown via curl Serve markdown converted to html to browsers Extract youtube subtitles Source https://github.com/tarasglek/markdown-download https://www.val.town/v/taras/markdown_download License: MIT Usage: https://markdown.download/ + URL Dev: https://val.markdown.download/ + URL
curtcox avatar
MarkdownCommand
@curtcox
script
An interactive, runnable TypeScript val by curtcox
pomdtr avatar
val_town_search
@pomdtr
http
Val Town Search Search for vals using the Github API. Either use the provided UI, or the query param: https://val-town-search.pomdtr.me/search?q=fetchJSON How does it work ? I've wrote about it! Todos [x] Embed the results in the UI [x] Refresh the vals on a cron using a github action [ ] Improve layout on small screens [ ] Support json Accept header [ ] Add pagination params [ ] Allow to filter by authors
compuives avatar
staticChess
@compuives
http
Static Chess Check it out here: https://chess.maxmcd.com Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves? Functionality is quite limited, and things might be broken. Please let me know if you find bugs! Inspired by this HN discussion about sites that have all possible game states of tic-tac-toe. I plan on extending this to support real gameplay. I think it could be a nice simple interface for long form games with friends. Might also be fun to add a static AI to play against. Feel free to PR any changes if you'd like to see something added.
maxm avatar
tinygoHttpExample
@maxm
http
A Go http handler running in Val Town: Using this go source file , this go library , this Deno library , and this script . Image rendering is happening here . Mandelbrot rendering code taken from here . Blog post, libraries with readmes and more info coming! package main import ( "fmt" "net/http" gotown "github.com/maxmcd/go-town" ) func main() { img := renderImage() gotown.ListenAndServe(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/mandelbrot.png" { w.Header().Set("Content-Type", "image/png") w.Write(img) return } w.Header().Set("Content-Type", "text/html") fmt.Fprintf(w, ` <head><link rel="icon" href="/mandelbrot.png"></head> <style>body {font-family: sans-serif}</style> Go-Rendered mandelbrot image served from a Go HTTP handler <a href="https://www.val.town/v/maxm/tinygoHttpExample">on Val Town</a> <br /><img src='/mandelbrot.png' /> `) })) }
pattysi avatar
OpenAI
@pattysi
script
OpenAI - Docs ↗ Use OpenAI's chat completion API with std/openai . This integration enables access to OpenAI's language models without needing to acquire API keys. Streaming is not yet supported. Upvote the HTTP response streaming feature request if you need it! Usage import { OpenAI } from "https://esm.town/v/std/openai"; const openai = new OpenAI(); const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" }, ], model: "gpt-4", max_tokens: 30, }); console.log(completion.choices[0].message.content); Limits While our wrapper simplifies the integration of OpenAI, there are a few limitations to keep in mind: Usage Quota : We limit each user to 10 requests per minute. Features : Chat completions is the only endpoint available. If these limits are too low, let us know! You can also get around the limitation by using your own keys: Create your own API key on OpenAI's website Create an environment variable named OPENAI_API_KEY Use the OpenAI client from npm:openai : import { OpenAI } from "npm:openai"; const openai = new OpenAI(); 📝 Edit docs
stevekrouse avatar
linkInBioTemplate
@stevekrouse
http
@jsxImportSource https://esm.sh/react