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.
zackoverflow avatar
zackoverflow
pollRssAndEmail
Script
Subscribe to RSS feeds with e-mail notifications This lets you subscribe to RSS feeds. It checks periodically for any new posts from any of your RSS feed subscriptions, and then sends you an e-mail with the link to the any new posts. Getting started 1. Generate auth keys Follow this to get your auth keys, and export your public keys. This will be used to e-mail yourself since @std.email is preferred over console.email 2. Create a @me.rssEmail val You can do that by clicking this link and hitting 'Run'. Or you can copy-paste this code into a new val: const rssEmail = "you@youremail.com" 3. Fork this val Hit 'Fork' on this val and run it. Then you can schedule the val to run every hour or whatever duration you'd like. 4. Add RSS feeds to @me.rssFeeds If you look at your vals, you should find a new one called rssFeeds . It should look similar to this: let rssFeeds = [ "https://cprimozic.net/rss.xml", "https://matklad.github.io/feed.xml", "https://journal.stuffwithstuff.com/rss.xml", "https://lexi-lambda.github.io/feeds/all.rss.xml", ]; This is supposed to be an array containing the links of each RSS feed you'd like to subscribe to (in the form of JS strings). To add RSS feeds, you can update this val by adding a new string containing the new RSS link. Resetting the cache If for any reason you would like to reset the cache, you can clear the keys of rssCache or use this convenience function to do so. @zackoverflow.rssResetCache(@me.rssCache)
2
maxm avatar
maxm
simpleWikipediaInstantSearch
HTTP
Simple Wikipedia Instant Search A quick demo of getting fuzzy matching and instant search working on Val Town
2
maxm avatar
maxm
transformEvalCode
Script
See: https://www.val.town/v/maxm/eval
0
siygle avatar
siygle
resumeHandler
HTTP
Forked from iamseeley/resumeHandler
0
nbbaier avatar
nbbaier
paginatedResponse
Script
Return a paginated response A helper function to take an array and return a paginated response. This is useful when defining one's own folders for pomdtr's vscode extension . Usage: const data = [...] export default async function(req: Request): Promise<Response> { return paginatedResponse(req, data); } For demo usage in the context of the vscode extension see this val .
1
nbbaier avatar
nbbaier
saveToTana
Script
Save To Tana This val provides a function saveToTana allows the creation of nodes in Tana via their Input API . The parameters are as follows: Token: to access the Tana Input API, you must pass an API token to the function. Obtain an API token from the Tana app and save it as a secret in Val Town. Node: the node that is created within Tana is passed as the second argument and must conform to the shape of an Input API node (see the documentation on github for details. Target node: optionally, you can specify a specific target node by passing a node ID to the function as it's third argument. Example Usage One way to use this val is with a web endpoint that you can send data to to have parsed and submitted to Tana as a specific type of node. For example, this val import { saveToTana } from "https://esm.town/v/nbbaier/saveToTana"; import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes"; import { Hono } from "npm:hono"; const token = Deno.env.get("tanaInputAPI"); export const honoTanaEndpoint = async (req: Request) => { const app = new Hono(); app.get("/", async c => { let { text, url } = c.req.query(); const payload: APIPlainNode = { name: text, children: [ { type: "field", attributeId: "cwi23sOzRSh8", children: [ { dataType: "url", name: url, }, ], }, ], supertags: [], }; const newNode = await saveToTana(token, payload); return c.json({ newNode }); }); return app.fetch(req); }; Combined with a Chrome extension like Rich URL , the above val allows one to send selected text on a page along with that pages URL to Tana via the val's public GET endpoint.
0
kingishb avatar
kingishb
blackLobster
Cron
Send a weekly email digest of good times to go for a bike ride.
5
brownieinmotion avatar
brownieinmotion
georgiaTechRegistration
HTTP
// ported from https://github.com/brownie-in-motion/gt-waitlist-bot
0
maas avatar
maas
forwarder
Script
Unlimited Anonymous Emails All code can be triggered via email ( docs ), i.e. maas.forwarder@valtown.email . You can generate as many emails as you want to avoid giving away your personal email address and reduce spam. Getting started Log in to Val Town Fork this Val Publish the Val via 🔒 > Unlisted Copy the email endpoint via ⋮ > Endpoints > Copy email address Sign up for newsletters or services using this email ( maas.forwarder@valtown.email ). To remove their ability to email you, simply delete the val (or send it to /dev/null ).
3
janpaul123 avatar
janpaul123
indexValsTurso
Cron
Forked from sqlite/leaderboard
0
samwillis avatar
samwillis
pglite
HTTP
Forked from maxm/pgliteNpm
2
yawnxyz avatar
yawnxyz
luciaValtownSqlite
Script
A reorganization of: https://www.val.town/v/stevekrouse/lucia_adapter https://esm.town/v/stevekrouse/lucia_adapter_base
1
eseidel avatar
eseidel
blueskyAlert
Cron
Forked from stevekrouse/blueskyAlert
0
iamseeley avatar
iamseeley
resumeConfig
Script
⚙️ configuration for hello, resume this guide will help you configure and use the resume builder to create your resume page. Ensure that your resume is formatted according to the JSON Resume standard . This is crucial for the resume builder to interpret and render your resume correctly. If you don't want to take the time to manually format your resume content and set up hosting, try using this: Resume to JSON 1. Configure the Resume JSON You have two options to provide your resume data: Resume JSON URL : Point this to your raw resume JSON hosted online. Recommended setups include using Val Town or a GitHub Gist. Example: resumeJsonUrl: 'https://example.com/resume.json' Paste Resume JSON : Provide the resume JSON directly within the configuration. Example: resumeJson: { "basics": { "name": "John Doe" }, "work": [ ... ] } 2. Choose a Theme Select a theme for your resume. You can use the predefined themes or create your own: Predefined Themes : starterTheme oceanTheme Custom Theme : Customize the styles in the starterTheme or create a new one and import it. 3. Custom Styles (Optional) If you want to add additional styles, provide a URL to a custom stylesheet: Example: customStyleUrl: 'https://example.com/styles.css' 4. Set the Section Order Customize the order of the sections in your resume: Default order: sectionOrder: ['header', 'summary', 'education', 'work', 'projects', 'volunteer', 'awards', 'certificates', 'publications', 'skills', 'languages', 'interests', 'references'] Example custom order: sectionOrder: ['header', 'summary', 'projects', 'education', 'work'] 5. Add Custom Sections (Optional) Override any default sections with custom sections: Example: customSections: { header: customHeader } 6. Show/Hide "Save as PDF" Button Control the visibility of the "Save asPDF" button: Example: savePDFIsVisible: true 7. View Your Resume Copy this resumeConfig's module URL and import it in your resumeHandler . Visit the resumeHandler HTTP endpoint to view your resume!
2
inkpotmonkey avatar
inkpotmonkey
instructorExample
Script
Example copied https://instructor-ai.github.io/instructor-js/#usage into val.town You will need to fork this and properly set the apiKey and organisation for it to work.
0
pomdtr avatar
pomdtr
sunbeamValTownFn
HTTP
Sunbeam integration for Val Town Installation First, install sunbeam . Then create a new val referencing this val. const sunbeamValtown = @pomdtr.sunbeamValTownFn(@me.secrets.valtown) then switch it's visibility to unlisted. You can then install your val in sunbeam # install the extension sunbeam extension install --alias valtown val:<username>/sunbeamValtown Usage sunbeam valtown # list your vals sunbeam valtown --help # list available commands Demo
1