4try {
5const browser = await puppeteer.connect({
6browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
7});
8
Badge_Generatormain.tsx1 match
136<meta charset="UTF-8">
137<meta name="viewport" content="width=device-width, initial-scale=1.0">
138<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
139<title>Val Town Badge Generator</title>
140<style>${css}</style>
freesoundSearchmain.tsx3 matches
7import * as qs from "https://deno.land/x/querystring@v1.0.2/mod.js";
89const FREESOUND_API_KEY = Deno.env.get("FREESOUND_API_KEY");
10const BASE_URL = "https://freesound.org/apiv2";
1112interface FreeSoundResponse {
28const queryString = qs.stringify({
29query: query,
30token: FREESOUND_API_KEY,
31fields: "id,name,previews",
32page_size: 1,
iframeGridInfinitemain.tsx4 matches
142setIsLoading(true);
143try {
144const response = await fetch('/api/submit-url', {
145method: 'POST',
146headers: {
162const loadUrlDatabase = async () => {
163try {
164const response = await fetch('/api/load-urls');
165if (!response.ok) throw new Error('Failed to load URLs');
166const loadedUrls = await response.json();
256257async function server(request: Request): Promise<Response> {
258if (request.method === 'POST' && new URL(request.url).pathname === '/api/submit-url') {
259return handleSubmitUrl(request);
260}
261262if (request.method === 'GET' && new URL(request.url).pathname === '/api/load-urls') {
263return handleLoadUrls();
264}
blindIvoryArmadillomain.tsx4 matches
1type _Capitalize<T extends string> = T extends `${infer Letter}` ? Uppercase<Letter> : T;
2type Check = _Capitalize<"test">;
34type SimpleCapitalize<T extends string> = Uppercase<T>;
5type SimpleCapitalizeCheck = SimpleCapitalize<"second_test">;
drumMachinemain.tsx1 match
1// A web audio drum machine that pulls samples from the Freesound search API.
2// A 16-step step sequencer with 4 sampled voices. Each sample is the first two
3// seconds of a Freesound search result. Tweaking the search string a little bit
broadRedMarmosetmain.tsx20 matches
11e.preventDefault();
12setLoading(true);
13console.log(`Submitting URL for scraping: ${url}`);
14try {
15const response = await fetch("/scrape", {
22setResult(data);
23} catch (error) {
24console.log(`Error occurred while scraping URL: ${url}. Error details: ${error.message}`);
25setResult({ error: error.message });
26}
40/>
41<button type="submit" disabled={loading}>
42{loading ? "Scraping..." : "Scrape"}
43</button>
44</form>
77async function scrapePage(url) {
78console.log(`Starting to scrape page: ${url}`);
79const apiKey = Deno.env.get("ScrapingBeeAPIkey");
80if (!apiKey) {
81console.log("ScrapingBee API key not found in environment variables");
82throw new Error("ScrapingBee API key not found in environment variables");
83}
8489const threadmarkUrl = `${url}/threadmarks?hide_wrapper=1&display=embedded&threadmark_category=${category}`;
90const response = await fetch(
91`https://app.scrapingbee.com/api/v1/?api_key=${apiKey}&url=${
92encodeURIComponent(threadmarkUrl)
93}&render_js=true&premium_proxy=true&stealth_proxy=true`,
128};
129130console.log(`Sending request to ScrapingBee for URL: ${url} at ${new Date().toISOString()}`);
131const startTime = Date.now();
132try {
133const requestUrl = `https://app.scrapingbee.com/api/v1/?api_key=${apiKey}&url=${
134encodeURIComponent(url)
135}&render_js=true&premium_proxy=true&stealth_proxy=true&extract_rules=${
142143const duration = Date.now() - startTime;
144console.log(`Received response from ScrapingBee at ${new Date().toISOString()}. Duration: ${duration}ms`);
145console.log(`Received response from ScrapingBee for URL: ${url}. Status: ${response.status}`);
146147if (!response.ok) {
148console.log(`Error response from ScrapingBee. Status: ${response.status}`);
149const errorBody = await response.text();
150console.log(`Error response body: ${errorBody}`);
183};
184} catch (error) {
185console.log(`Error occurred while scraping URL: ${url}`);
186console.log(`Error details: ${error.message}`);
187console.log(`Error stack: ${error.stack}`);
190}
191192async function getApiKey() {
193const apiKey = Deno.env.get("ScrapingBeeAPIkey");
194if (!apiKey) {
195console.log("ScrapingBee API key not found in environment variables");
196throw new Error("ScrapingBee API key not found in environment variables");
197}
198return apiKey;
199}
200
1## Random Maps API
23This val returns one or more random rows from a [SQLite database](https://docs.val.town/std/sqlite/usage/) as a JSON array. Each item represents a digitised map from a collection and contains the following properties:
Chatprincipalmain.tsx1 match
494<title>Cicero AI - AI-powered Contract Creation</title>
495<meta name="viewport" content="width=device-width, initial-scale=1">
496<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
497</head>
498<body>
blob_adminREADME.md1 match
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1011It 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).
1213# TODO