1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns stars on Github repo
6// username, project name from url: github.com/joeroddy/bridg
7export const getGithubStarsForRepo = async (username: string, project: string) => {
8 const res = await fetchJSON(
9 `https://api.github.com/repos/${username}/${project}`
10 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD
33 console.log(
34 length
35 ? `Successfully fetched ${length} video${length === 1 ? "" : "s"}`
36 : "No videos found",
37 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch8 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const thedyslexicdeveloperTikTok = (async () => {
4 const cheerio = await import("npm:cheerio");
5 const html = await fetchText(
6 `https://www.tiktok.com/@thedyslexicdeveloper`,
7 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchGHRepoInfo(userName, repoName) {
4 const response = await fetch(`https://ungh.cc/repos/${userName}/${repoName}`);
5 return await response.json();
6}
1// fetch("https://api.val.town/v1/express/ramkarthik.GenerateQR?url={url}"
2export async function GenerateQR(req, res) {
3 const url = req.query.url;
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const weather = async (city: string): Promise<unknown> => {
4 let data = await fetch(`https://wttr.in/${city}?format=j1`);
5 return data.json();
6};
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub starred repos
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred"
6);