7 publicStats: false,
8 };
9 const { shortLink } = await ky.post("https://dub.co/api/links", { json }).json<any>();
10 return new URL(shortLink);
11}
50 <head>
51 <title>SQLite Explorer</title>
52 <link rel="preconnect" href="https://fonts.googleapis.com" />
53 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
54 <link
55 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
56 rel="stylesheet"
57 />
9[](https://val.town/new?code=export%20%7B%20default%20as%20blob_admin%20%7D%20from%20%22https%3A%2F%2Fesm.town%2Fv%2Fstevekrouse%2Fblob_admin%22)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
6 try {
7 const result = await fetchJSON(
8 "https://api.brightdata.com/customer/balance",
9 {
10 method: "GET",
1import { OpenAI } from "npm:openai";
2Deno.env.get("OPENAI_API_KEY");
3
4const openai = new OpenAI();
3This uses the brand new `gpt-4-1106-preview`.
4
5To use this, set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
8}
9
10// API Endpoint to increment the number
11// Example endpoint: /increment
12app.post('/increment', (req, res) => {
1# Handling query params in requests
2
3Using the standard [URL#searchParams](https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams) method, you can grab query parameters out of any val that is operating using the [Web API](https://docs.val.town/api/web).
4
5This val demonstrates how to grab one or more query parameters. It returns the all the query parameters found as a json response.
13Change the `query` variable for what you want to get notified for.
14
15You can use [Twitter's search operators](https://developer.twitter.com/en/docs/twitter-api/v1/rules-and-filtering/search-operators) to customize your query, for some collection of keywords, filtering out others, and much more!
16
17## 3. Notification