blob_adminmain.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";
133});
134135export default modifyFetchHandler(passwordAuth(app.fetch));
2import { updateValByName } from "https://esm.town/v/nbbaier/updateValByName?v=14";
3import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth?v=62";
4import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
5import { chat } from "https://esm.town/v/stevekrouse/openai";
6import cronstrue from "npm:cronstrue";
19It stores each line of the poem in sqlite.
20It has a textbox that lets anyone input a new line to the poem.`,
21content: await fetchText("https://esm.town/v/stevekrouse/poembuilder3?v=4"),
22},
23{
24user: "an app that uses chatgpt to convert natural language to cron syntax",
25content: await fetchText("https://esm.town/v/stevekrouse/cron2"),
26},
27];
29const app = new Hono();
3031export default basicAuth(app.fetch);
32app.get("/", async (c) => {
33const example = examples[Math.floor(Math.random() * examples.length)];
98Write ONLY Deno TypeScript.
99
100If you use Hono, use \`export default app.fetch;\` to start the server.
101
102Only use web standard fetch.
103// Our library for SQLite
104import { sqlite } from "https://esm.town/v/std/sqlite";
2import { home, scopesRoute } from "https://esm.town/v/hunty/spotify_helpers";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
5import { querystring } from "https://esm.town/v/stevekrouse/querystring";
6import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL";
2526export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
27fetchJSON("https://accounts.spotify.com/api/token", {
28method: "POST",
29body: querystring({
3940export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
41fetch("https://accounts.spotify.com/api/token", {
42method: "POST",
43body: new URLSearchParams({
191192try {
193const currentlyPlaying = await fetch("https://api.spotify.com/v1/me/player/currently-playing", {
194method: "GET",
195headers: {
207208if (!mostRecentTrack) {
209const recentTracks = await fetch("https://api.spotify.com/v1/me/player/recently-played", {
210method: "GET",
211headers: {
220}
221catch (e) {
222return c.json({ error: "Fetch Error" + e }, 500);
223}
224});
232233try {
234const playStateResponse = await fetch("https://api.spotify.com/v1/me/player?market=US", {
235method: "GET",
236headers: {
251}
252catch (e) {
253return c.json({ error: "Fetch Error" + e }, 503);
254}
255});
256257export default app.fetch;
dailyPoemForSammain.tsx3 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23async function getRandomPoem() {
4const response = await fetch("https://poetrydb.org/random");
5const [poem] = await response.json();
6return poem;
16const message = `Daily Poem:\n\n${title}\nby ${author}\n\n${lines}`;
17
18const response = await fetch('https://samwho-notify.web.val.run', {
19method: 'POST',
20headers: {
urlMetadatamain.tsx1 match
6return metadata;
7} catch (err) {
8console.error('Error fetching metadata:', err);
9return null;
10}
99100export default async function handler(req: Request): Promise<Response> {
101return await app.fetch(req);
102}
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
317}
1819const resp = await fetch("https://api.pushover.net/1/messages.json", {
20headers: {
21"Content-Type": "application/json",
isMyWebsiteDownmain.tsx2 matches
9let reason: string;
10try {
11const res = await fetch(URL, { redirect: "follow" });
12if (res.status !== 200) {
13reason = `(status code: ${res.status})`;
15}
16} catch (e) {
17reason = `couldn't fetch: ${e}`;
18ok = false;
19}
randomCardImagemain.tsx4 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export default async function(req: Request): Promise<Response> {
4try {
5const response = await fetch(
6"https://deckofcardsapi.com/api/deck/new/draw/?count=1",
7);
14}
15} catch (error) {
16console.log("Error fetching random card image:", error);
17return Response.json({
18error: `An error occurred while fetching the random card image. ${error}`,
19}, { status: 400 });
20}
1/** @jsxImportSource npm:hono@3/jsx */
2import { fetch as proxyFetch } from "https://esm.town/v/std/fetch";
3import { Hono } from "npm:hono";
4const Fetch = fetch;
56interface ShowBox {
35const { id } = c.req.param();
36const post_data = `fid=${id.split(".")[1]}&share_key=${id.split(".")[0]}`;
37const streamApiRequest = await fetch(`https://www.febbox.com/file/player?${post_data}`, {
38method: "POST",
39headers: headers,
69const _tv = (type === "S") ? `.${season}.1` : "";
70console.log(_tv);
71const idApiRequest = await fetch(`https://api.dmdb.network/v1/gmid/${type}.${tmdb}${_tv}`);
72const idApiJson = await idApiRequest.json();
73console.log(idApiJson);
78const mode = type === "M" ? 1 : 2;
79const sheguId = idApiJson["ids"]["superstream"];
80const showbox = await fetch(`https://www.showbox.media/index/share_link?id=${sheguId}&type=${mode}`, {
81headers: headers,
82});
85const febboxUrl = `https://www.febbox.com/share/${febboxId}`;
86console.log(febboxId);
87const febboxItemRequest = await fetch(`https://www.febbox.com/file/file_share_list?share_key=${febboxId}`, {
88headers: headers,
89});
122if (season === Number(season_number)) {
123const febboxSeasonId = item.fid;
124const lastPage = await fetch(
125`https://www.febbox.com/file/file_share_list?page=1&share_key=${febboxId}&pwd=&parent_id=${febboxSeasonId}`,
126{
137}
138const totalPages = Math.ceil(latestEpisode / 30) + 1;
139// _temp = await fetch(`https://www.febbox.com/file/file_share_list?page=${totalSections}&share_key=${febboxId}&pwd=&parent_id=${febboxSeasonId}`);
140// let _tempr = await _temp.json()
141// const late = _tempr.data.file_list.length;
154console.log(predictedPages);
155for (const page of predictedPages) {
156episodedReq = await fetch(
157`https://www.febbox.com/file/file_share_list?page=${page}&share_key=${febboxId}&pwd=&parent_id=${febboxSeasonId}`,
158{
183}
184}
185export default app.fetch;