Air quality API examples & templates
Use these vals as a playground to view and fork Air quality API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
dthyresson
airportCodeMapRedirector
IATA Airport Code Map Redirector I needed way redirect to a map for a given aiport given an IATA airport code . This way is it's a simple proxy redirect and I can change if I want to use Google Maps or another service (or change zoom levels, etc) without having to update the link. Usage: Boston Logan: https://iata.thyresson.io?q=bos
nknj
salmonMole
Find comments on HN (powered by Algolia ), extract content and return a streaming markdown summary (powered by Substrate ). The RAG portion of this is 34 lines of Substrate code. Read the walkthrough: https://x.com/vprtwn/status/1812844236401762513 šŖ© To fork, sign up for Substrate to get your own API key and $50 free credits. See also: https://www.val.town/v/substrate/twitterRAG
qiangua
similarSites
Find similar pages on HN and return a streaming markdown summary. Powered by Exa and Substrate . šŖ© To fork, sign up for Substrate to get your own API key and $50 free credits.

yawnxyz
stringInferExample
example of inferring params from a prompt: https://x.com/yawnxyz/status/1812922642510586039 putting results in does wonders use an "extraction guide" to direct results
tmcw
typeboxExample
This val demonstrates how TypeBox objects
are interchangeable with JSON Schema objects - if you run
JSON.stringify() on one of them, you immediately get a JSON Schema validator. They do, in memory, have additional methods and information, but their easy conversion
to JSON Schema objects is a major win.
dglazkov
qdrant
Since Qdrant Cloud has a fairly strict CORS policy, here's a simple val that proxies calls to Qdrant Cloud API and makes them accessible from Web apps. To set up: fork this val add your QDRANT_API_KEY to your environment variables. This would limit usage of your proxy to your API key only. start using val as a proxy Use it as a 1:1 replacement for Qdrant API, except for one additional query string parameter: cluster_id -- the part of the Qdrant API endpoint before cloud.qdrant.io .
nerdymomocat
add_to_habitify_from_todoist_w_ai
// if you added new items to habitify after running this script
maxm
openAIStreaming
OpenAI Streaming - Assistant and Threads An example of using OpenAI to stream back a chat with an assistant. This example sends two messages to the assistant and streams back the responses when they come in. Example response: user > What should I build today?
................
assistant > Here are a few fun Val ideas you could build on Val Town:
1. **Random Joke Generator:** Fetch a random joke from an API and display it.
2. **Daily Weather Update:** Pull weather data for your location using an API and create a daily summary.
3. **Mini Todo List:** Create a simple to-do list app with add, edit, and delete functionalities.
4. **Chuck Norris Facts:** Display a random Chuck Norris fact sourced from an API.
5. **Motivational Quote of the Day:** Fetch and display a random motivational quote each day.
Which one sounds interesting to you?
user > Cool idea, can you make it even cooler?
...................
assistant > Sure, let's add some extra flair to make it even cooler!
How about creating a **Motivational Quote of the Day** app with these features:
1. **Random Color Theme:** Each day, the background color/theme changes randomly.
2. **Quote Sharing:** Add an option to share the quote on social media.
3. **Daily Notifications:** Send a daily notification with the quote of the day.
4. **User Preferences:** Allow users to choose categories (e.g., success, happiness, perseverance) for the quotes they receive.
Would you like some code snippets or guidance on implementing any of these features?