v2FanFicScrapermain.tsx10 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
4// last stable version is 47
5function App() {
6const [url, setUrl] = useState("");
7const [result, setResult] = useState(null);
104}
105106function client() {
107console.log("Initializing client-side React application");
108createRoot(document.getElementById("root")).render(<App />);
116const _REGEX_POST_URL = /posts\/(?<id>\d+)/;
117118function normalizeUrl(url) {
119const threadMatch = url.match(_REGEX_THREAD_URL);
120const postMatch = url.match(_REGEX_POST_URL);
128}
129130async function scrapePage(url) {
131console.log(`Starting to scrape page: ${url}`);
132const apiKey = await getApiKey();
165}
166167function processThreadmarks(threadmarks) {
168return threadmarks.map(tm => {
169let category = "1";
201}
202203async function scrapePageWithRules(url, apiKey, extractRules) {
204console.log(`Sending request to ScrapingBee API for URL: ${url}`);
205try {
245}
246247function processResults(results) {
248console.log("Processing results:", JSON.stringify(results, null, 2));
249if (!results || results.length === 0) {
275}
276277function processPost(post) {
278return {
279id: post.id,
286}
287288async function getApiKey() {
289const apiKey = Deno.env.get("ScrapingBeeAPIkey");
290if (!apiKey) {
295}
296297export default async function server(request) {
298console.log(`Received ${request.method} request for path: ${new URL(request.url).pathname}`);
299if (request.method === "POST" && new URL(request.url).pathname === "/scrape") {
count_visitsmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [websiteUrl, setWebsiteUrl] = useState("");
7const [embedCode, setEmbedCode] = useState("");
61}
6263function client() {
64createRoot(document.getElementById("root")).render(<App />);
65}
69}
7071async function server(request: Request): Promise<Response> {
72const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
73const SCHEMA_VERSION = 1;
92import { useState, useEffect } from 'react';
9394function VisitorCounter() {
95const [count, setCount] = useState(0);
96
8});
910export default async function(req: Request) {
11if (req.method === "POST") {
12const formData = await req.formData();
whoIsHiringmain.tsx3 matches
7import About from "https://esm.town/v/vawogbemi/whoIsHiringAbout";
89function App() {
10const tabs = { "/": "Home", "/about": "About" };
11const [activeTab, setActiveTab] = useState("/");
335}
336337function ServerApp() {
338return (
339<html>
358}
359360export default async function(req: Request): Promise<Response> {
361const url = new URL(req.url);
362if (url.pathname === "/api/stories") {
imagesToPDFmain.tsx6 matches
15import { Hono } from 'npm:hono';
1617function html() {
18/*
19<!DOCTYPE html>
38}
3940function css() {
41/*
42body {
82}
8384function js() {
85/*
86const { jsPDF } = window.jspdf;
91convertBtn.addEventListener('click', convertToPDF);
9293async function convertToPDF() {
94const files = imageInput.files;
95if (files.length === 0) {
121}
122123function readFileAsDataURL(file) {
124return new Promise((resolve, reject) => {
125const reader = new FileReader();
130}
131132function loadImage(blob) {
133return new Promise((resolve, reject) => {
134const src = URL.createObjectURL(blob);
satisfactoryBlushCatsharkmain.tsx2 matches
2import { base58 } from "npm:@scure/base";
34export function convertUUIDToToken(uuid: string): string {
5return "vt_" + base58.encode(Buffer.from(uuid.replace(/-/g, ""), "hex"));
6}
78export function generateAndConvertUUIDs() {
9const uuidBuffer = Buffer.alloc(16);
10let tokenLength = 0;
bedtimeStoryMakermain.tsx2 matches
41const identifier = "bedtime-story-limiter";
4243async function enforceRateLimit() {
44const ratelimit = await unkey.limit(identifier);
4552const app = new Hono();
5354function parseStory(text) {
55// Split the text into lines and remove empty lines
56const lines = text.split("\n").filter(line => line.trim() !== "");
bikeInventorymain.tsx7 matches
6const APP_ID = "5518c0f9-481c-4aa8-85cd-eee42bd45319";
78function BikeWindow({ bike, onSave, onClose, title }) {
9const [brand, setBrand] = useState(bike?.brand || "");
10const [model, setModel] = useState(bike?.model || "");
112}
113114function App() {
115const [bikes, setBikes] = useState([]);
116const [error, setError] = useState(null);
315}
316317function client() {
318console.log("Client function called");
319const root = document.getElementById("root");
320if (root) {
327328if (typeof document !== "undefined") {
329console.log("Document is defined, calling client function");
330client();
331} else {
333}
334335async function server(request: Request): Promise<Response> {
336console.log("Server function called");
337return new Response(
338`
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
1export default function(req: Request) {
2const url = new URL(req.url);
3const newUrl = "https://opensourcepledge.com" + url.pathname + url.search;