dateme_migratedmain.tsx2 matches
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { form } from "https://esm.town/v/stevekrouse/date_me_form";
3import browse from "https://esm.town/v/stevekrouse/dateme_browse";
13app.get("/faq", faq);
14app.get("/rss.xml", c => dateMeRSS(c.req as unknown as Request));
15export default modifyFetchHandler(app.fetch, {
16style: `@media (max-width: 500px) {
17.github-fork-ribbon {
hnCloneLuciaOauthmain.tsx15 matches
1617useEffect(() => {
18fetchStories();
19fetchUser();
20}, []);
2122const fetchStories = async () => {
23const response = await fetch('/stories');
24const data = await response.json();
25setStories(data);
26};
2728const fetchUser = async () => {
29const response = await fetch('/user');
30const data = await response.json();
31setUser(data.username);
32};
3334const fetchComments = async (storyId) => {
35const response = await fetch(`/comments/${storyId}`);
36const data = await response.json();
37setComments(data);
42const title = event.target.title.value;
43const url = event.target.url.value;
44await fetch('/submit', {
45method: 'POST',
46headers: { 'Content-Type': 'application/json' },
47body: JSON.stringify({ title, url }),
48});
49fetchStories();
50event.target.reset();
51};
53const upvoteStory = async (storyId) => {
54if (!user) return;
55await fetch('/upvote', {
56method: 'POST',
57headers: { 'Content-Type': 'application/json' },
58body: JSON.stringify({ storyId }),
59});
60fetchStories();
61};
6264event.preventDefault();
65const content = event.target.content.value;
66await fetch('/comment', {
67method: 'POST',
68headers: { 'Content-Type': 'application/json' },
69body: JSON.stringify({ storyId: currentStory.id, content, parentId }),
70});
71fetchComments(currentStory.id);
72event.target.reset();
73};
139<span className="story-link" onClick={() => {
140setCurrentStory(story);
141fetchComments(story.id);
142}}>{story.timestamp}</span>
143</div>
muddyAmethystLimpetmain.tsx1 match
2728try {
29const response = await fetch('/upload', {
30method: 'POST',
31body: formData,
2425try {
26const response = await fetch('/upload', {
27method: 'POST',
28body: formData,
pdfExtractTextmain.tsx1 match
3export default async function pdfExtractText(data: ArrayBuffer) {
4const pdfExtract = new PDFExtract();
5// const req = await fetch("https://morth.nic.in/sites/default/files/dd12-13_0.pdf");
6// const data = await req.arrayBuffer();
7const options: PDFExtractOptions = {}; /* see below */
hackerNewsDigestmain.tsx8 matches
3import { email } from "https://esm.town/v/std/email";
45async function fetchStories(type: string, count: number) {
6const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7const storyIds = await response.json();
8const stories = await Promise.all(
9storyIds.slice(0, count).map(async (id: number) => {
10const storyResponse = await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`);
11return storyResponse.json();
12}),
120export default async function server(req: Request) {
121try {
122const topStories = await fetchStories("top", 10);
123const newStories = await fetchStories("new", 5);
124const showStories = await fetchStories("show", 3);
125const askStories = await fetchStories("ask", 3);
126const jobStories = await fetchStories("job", 3);
127128const emailContent = createEmailContent(topStories, newStories, showStories, askStories, jobStories);
serveGithubRepomain.tsx1 match
37}
3839// we use import instead of fetch to leverage deno's caching
40const { default: res } = await import(
41`https://2json.deno.dev/raw.githubusercontent.com/${params.owner}/${params.repo}/${params.ref || "main"}`
cautiousMoccasinSnakemain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138139export default modifyFetchHandler(passwordAuth(app.fetch));
sqliteExplorerAppmain.tsx4 matches
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
25visited.add(url);
2627const response = await fetch(url);
28const html = await response.text();
29const $ = cheerio.load(html);