72}
73
74async function getAccessTokenWithValTown(valTownAPIKey?: string): Promise<string> {
75 if (valTownAPIKey) Deno.env.set("valtown", valTownAPIKey);
76 const { blob } = await import("https://esm.town/v/std/blob");
77 const KEY = "aliyunpan-checkin";
10 }
11 console.log(id);
12 console.log(`https://music.163.com/api/v3/song/detail?id=${id}&c=[{"id":"${id}"}]`);
13
14 var uri = `https://music.163.com/api/v3/song/detail?id=${id}&c=[{"id":"${id}"}]`;
15 var encodedUri = encodeURI(uri);
16
21 [data1, data2] = await Promise.all([
22 fetch(encodedUri),
23 fetch(`https://music.163.com/api/song/media?id=${id}`),
24 ]);
25
1// Function to upload data using Wormhole API and return the URL
2async function uploadToFileIo(file) {
3 const formData = new FormData();
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example
16 GistGPT
17 </h1>
18 <p class="mb-4">Client for the <a class="underline" target="_blank" href="https://www.val.town/v/weaverwhale/GistGPT">GistGPT API</a></p>
19 <p class="mb-4">Provide a RAW file URL from Github, BitBucket, GitLab, Val Town, etc. and GistGPT will provide you the gist of the code.</p>
20 <input
22 placeholder="Provide a raw gist link here"
23 />
24 <p class="my-4">Have it summarize <a class="inline-block underline cursor-pointer" id="summarize-this">this file</a>, or <a class="inline-block underline cursor-pointer" id="summarize-api">the API's file</a> and it will explain how it works 🤯</p>
25 </body>
26 <script>
27 document.getElementById("summarize-api").addEventListener("click", (e) => {
28 e.target.disabled = true;
29 window.location.href = "/gist?url=https://esm.town/v/weaverwhale/GistGPT";
30 document.querySelector("input").value = "Summarizing the API\'s file...";
31 })
32
15 PriestGPT
16 </h1>
17 <p class="mb-4">Client for the <a class="underline" href="https://www.val.town/v/mjweaver01/PriestGPT">PriestGPT API</a></p>
18 <p class="mb-4">Ask him about books or verses in the bible, and he will be sure to give you a short sermon about it!</p>
19 <input
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
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
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return punchline;
7}