1# trpc
2
3 Access private Val Town apis.
4
5> ⚠️ trpc endpoints can change at any time
1const baseURL = `https://www.val.town/api/trpc`;
2
3export const trpc = {
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
22 clientId: Deno.env.get("GITHUB_OAUTH_TEST1_CLIENT"),
23 clientSecret: Deno.env.get("GITHUB_OAUTH_TEST1_SECRET"),
24 userInfoUrl: "https://api.github.com/user"
25 },
26 google: {
28 clientSecret: Deno.env.get("GOOGLE_OAUTH_COVERSHEET_SECRET"),
29 redirectUri: "https://yawnxyz-hnclonehtmx.web.val.run/auth/google/callback",
30 userInfoUrl: "https://openidconnect.googleapis.com/v1/userinfo"
31 }
32 }
49 <a href="/auth/google">Sign in with Google</a>
50 <br>
51 <br>Note that Github and Google should work in principle, I just didn't configure them to work on this example in Google's API console or Github's thing :P
52 `);
53});
1// This scraper provides a simple HTML form to input a Zillow URL.
2// It then uses the fetch API to get the HTML content of the Zillow listing page,
3// parses it using cheerio to extract the required information,
4// and displays the results in a table.
75 `;
76 } catch (error) {
77 console.error("Error scraping Zillow:", error);
78 resultHtml = '<p>Error scraping Zillow listing</p>';
79 }
80 }
1// This approach will use the fetch API to get the Craigslist page content,
2// parse it using cheerio, extract the required information,
3// and render it in a table format. We'll use React for the client-side rendering.
54You can attach files to your emails by using the `attachments` field.
55Attachments need to be [Base64](https://en.wikipedia.org/wiki/Base64) encoded,
56which is that the [btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)
57method is doing in this example:
58
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { parseSendGridEmail } from "https://esm.town/v/stevekrouse/parseSendGridEmail?v=8";
3import { parseSendGridEmails } from "https://esm.town/v/stevekrouse/parseSendGridEmails?v=10";
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {
73 method: "POST",
2import { blob } from "https://esm.town/v/std/blob";
3// Bump version
4import { Routes } from "npm:@discord-api-types/v9";
5import { REST } from "npm:@discordjs/rest";
6import { createAudioPlayer, createAudioResource, joinVoiceChannel } from "npm:@discordjs/voice";
7import googleTTS from "npm:google-tts-api";
8let bank = await blob.getJSON("bank");
9let bets = await blob.getJSON("bets");
17 "Collaborative Whiteboard",
18 "Cryptocurrency Price Tracker",
19 "Custom API Wrapper",
20 "Data Visualization Dashboard",
21 "Distributed Computing Project",