3import Jimp from "npm:jimp";
45export async function blobReadPictureExample(request: Request): Promise<Response> {
6const searchParams = new URL(request.url).searchParams;
7const url = searchParams.get("url") || "https://www.browserbase.com";
browserbaseUtilsmain.tsx2 matches
5}
67export async function loadPageContent(url: string, options: LoadPageContentOptions = { textContent: false }) {
8const browser = await puppeteer.connect({
9browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
33}
3435export async function screenshotPage(url: string, options: ScreenshotPageOptions = { fullPage: true }) {
36const browser = await puppeteer.connect({
37browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
2import { email } from "https://esm.town/v/std/email?v=12";
34export default async function(interval: Interval) {
5const bbLandingChanged = await hasWebsiteChanged("https://www.browserbase.com");
6console.log("bbLandingChanged", bbLandingChanged);
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
stiffCoffeeLampreyREADME.md1 match
11import { email } from "https://esm.town/v/std/email?v=13";
1213export default async function (interval: Interval) {
14const bookingInfo = await resyBot( {
15slug: 'amaro-bar',
11import { email } from "https://esm.town/v/std/email?v=13";
1213export default async function (interval: Interval) {
14const bookingInfo = await resyBot( {
15slug: 'amaro-bar',
frozenSapphireIguanamain.tsx9 matches
8import { createRoot } from "https://esm.sh/react-dom/client";
910function App() {
11const [origin, setOrigin] = useState("");
12const [results, setResults] = useState([]);
237}
238239function client() {
240createRoot(document.getElementById("root")).render(<App />);
241}
245}
246247export default async function server(request: Request): Promise<Response> {
248console.log("Received request:", request.url);
249const url = new URL(request.url);
373});
374} catch (error) {
375console.error("Error in server function:", error);
376return new Response(JSON.stringify({ error: "An error occurred while calculating travel times", details: error.message }), {
377headers: { "Content-Type": "application/json" },
397}
398399async function findNearest(origin: string, locations: any[], apiKey: string): Promise<any> {
400console.log(`Finding nearest location among ${locations.length} options`);
401const batchSize = 25; // Google Maps API typically allows up to 25 destinations per request
439}
440441async function getDrivingTime(origin: string, destination: string, apiKey: string, arrivalTime?: string, arrivalDay?: string): Promise<string> {
442let directionsUrl = `https://maps.googleapis.com/maps/api/directions/json?origin=${encodeURIComponent(origin)}&destination=${encodeURIComponent(destination)}&mode=driving&key=${apiKey}`;
443
460}
461462async function getTransitTime(origin: string, destination: string, apiKey: string): Promise<string> {
463const directionsUrl = `https://maps.googleapis.com/maps/api/directions/json?origin=${encodeURIComponent(origin)}&destination=${encodeURIComponent(destination)}&mode=transit&key=${apiKey}`;
464475}
476477async function getZipCode(address: string, apiKey: string): Promise<string> {
478const geocodeUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(address)}&key=${apiKey}`;
479const response = await fetch(geocodeUrl);
490}
491492function getNextDayOfWeek(date: Date, dayOfWeek: string): Date {
493const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
494const targetDay = days.indexOf(dayOfWeek.toLowerCase());
grievingYellowAspmain.tsx3 matches
6import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
78// Utility functions
9const performSingleRequest = async (url) => {
10const start = performance.now();
46};
4748// Helper function to safely format numbers
49const safeToFixed = (number, decimalPlaces) => {
50return number !== undefined && number !== null
286}
287288export default async function(req: Request): Promise<Response> {
289const stream = await renderToReadableStream(<App />, { bootstrapModules: [import.meta.url] });
290return new Response(stream, { headers: { "content-type": "text/html" } });
checkHackerNewsForPatreonmain.tsx2 matches
9const TABLE_NAME = `${KEY}_notified_stories`;
1011async function initializeDatabase() {
12await sqlite.execute(`
13CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
19}
2021async function checkHackerNewsForPatreon() {
22await initializeDatabase();
23
serveUtilsmain.tsx4 matches
1export function getFunctionComment(fn) {
2try {
3return fn.toString().match(/\/\*\s*(.+)\s*\*\//s)[1];
4} catch (err) {
5console.error(`Failed to get function comment: ${err.message}\n${fn.toString()}`);
6throw err;
7}
8}
910export function serve(fn, contentType = 'text/plain') {
11return (ctx) => {
12return new Response(getFunctionComment(fn), {
13headers: {
14'Content-Type': contentType,