2import { email } from "https://esm.town/v/std/email?v=11";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=5";
4import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
5import { Hono } from "npm:hono@3";
6import locations from "../locations.json" with { type: "json" };
224join.get("/", Form);
225join.post("/", Submit);
226export default reloadOnSaveFetchMiddleware(join.fetch);
12app.get("/faq", faq);
13app.get("/rss.xml", c => rss(c.req.raw));
14export default app.fetch;
149
150 try {
151 const response = await fetch("/", {
152 method: "POST",
153 body: JSON.stringify({
1// This file would contain the actual Google Sheets import functionality
2// For a complete implementation, we would need to:
3// 1. Use the Google Sheets API to fetch sheet data
4// 2. Convert the data to a format compatible with x-spreadsheet
5// 3. Return the formatted data
61 const reviewsUrl = `https://www.amazon.com/product-reviews/${productId}/ref=cm_cr_arp_d_paging_btm_next_${page}?ie=UTF8&reviewerType=all_reviews&pageNumber=${page}`;
62
63 const response = await fetch(reviewsUrl, {
64 headers: {
65 'User-Agent': userAgent,
73
74 if (!response.ok) {
75 console.log(`Failed to fetch page ${page}: ${response.status}`);
76 break;
77 }
131
132 } catch (error) {
133 console.log(`Error fetching page ${page}:`, error);
134 break;
135 }
209});
210
211export default app.fetch;
1import { decodeXPaymentResponse, wrapFetchWithPayment } from "npm:x402-fetch";
2import { privateKeyToAccount } from "npm:viem/accounts";
3
5const account = privateKeyToAccount(PRIVATE_KEY as `0xstring`);
6
7const fetchWithPayment = wrapFetchWithPayment(fetch, account);
8
9const url = "https://stevedylandev--100deaa43be911f0af859e149126039e.web.val.run/joke";
10
11async function main() {
12 const response = await fetchWithPayment(url);
13 if (!response.ok) {
14 const message = await response.text();
41});
42
43export default app.fetch;
21app.get("/health", c => c.json({ status: "ok", timestamp: new Date().toISOString() }));
22
23export default app.fetch;
53
54 try {
55 const response = await fetch('/api/itinerary/generate', {
56 method: 'POST',
57 headers: { 'Content-Type': 'application/json' },
51 try {
52 setState(prev => ({ ...prev, isLoading: true }));
53 const response = await fetch('/api/itinerary');
54 const result = await response.json();
55
87 try {
88 // Check for existing progress
89 const response = await fetch(`/api/itinerary/${itinerary.id}/progress`);
90 const result = await response.json();
91
119
120 try {
121 await fetch(`/api/itinerary/${progress.itineraryId}/progress`, {
122 method: 'POST',
123 headers: { 'Content-Type': 'application/json' },
131 const handleDeleteItinerary = async (id: string) => {
132 try {
133 const response = await fetch(`/api/itinerary/${id}`, {
134 method: 'DELETE'
135 });