newRSSItemsmain.tsx2 matches
1import { fetchAndParseFeeds } from "https://esm.town/v/iakovos/fetchAndParseFeeds";
23export const newRSSItems = async ({ url, type, lastRunAt }) => {
4const items = await fetchAndParseFeeds(url);
5return items?.filter(({ pubDate }) =>
6lastRunAt && new Date(pubDate) > new Date(lastRunAt)
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export let meow = fetchJSON(
4"https://pokeapi.co/api/v2/pokemon/ditto"
5);
githubReposmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export let githubRepos = fetchJSON(
4"https://api.github.com/users/markthree/repos"
5);
load_new_subreddit_postsmain.tsx12 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export let load_new_subreddit_posts = async ({
5filters,
6after_utc,
7fetch_limit,
8}) => {
9let patterns = [];
23}
2425let next_fetch_from = null;
26let matches = [];
27let new_posts = 0;
28let fetches = 1;
29let data = await fetchJSON(
30`https://www.reddit.com/r/${subreddit}/new/.json`
31);
6566let last_post_name = data.data.children.at(-1).data.name;
67// mark this subreddit for additional fetches if it reached its budget
68if (fetches == fetch_limit) {
69next_fetch_from = last_post_name;
70break;
71}
72fetches += 1;
73data = await fetchJSON(
74`https://www.reddit.com/r/${subreddit}/new/.json?after=${last_post_name}`
75);
82new_posts: new_posts,
83matches: matches,
84fetches: fetches,
85next_fetch_from: next_fetch_from,
86};
87};
badWordsWith5LettersOrLessmain.tsx2 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export let badWordsWith5LettersOrLess = (async () => {
4const res = await fetch(
5"https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en",
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export let github = fetchJSON(
4"https://api.github.com/users/markthree"
5);
boredActivitiesmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5"https://www.boredapi.com/api/activity"
6);
test_concurrencyDoesntWorkmain.tsx17 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export const test_concurrencyDoesntWork = (async () => {
4const fetchDelayedResponse = async (index: number) => {
5const start = Date.now();
6const response = await fetch(
7"https://api.val.town/v1/express/alp.proxyFetch1",
8{
9method: "POST",
19);
20};
21const fetchDelayedResponseWithLoadBalancer = async (index: number) => {
22const start = Date.now();
23const response = await fetch(
24`https://api.val.town/v1/express/alp.proxyFetch${index}`,
25{
26method: "POST",
38console.log("w/o load balancer");
39await Promise.all([
40fetchDelayedResponse(1),
41fetchDelayedResponse(2),
42fetchDelayedResponse(3),
43fetchDelayedResponse(4),
44fetchDelayedResponse(5),
45]);
46console.log("w/ load balancer");
47await Promise.all([
48fetchDelayedResponseWithLoadBalancer(1),
49fetchDelayedResponseWithLoadBalancer(2),
50fetchDelayedResponseWithLoadBalancer(3),
51fetchDelayedResponseWithLoadBalancer(4),
52fetchDelayedResponseWithLoadBalancer(5),
53]);
54})();
peelSessionArtistmain.tsx2 matches
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
23export async function peelSessionArtist(url) {
4const dom = await fetchHtmlDom(url);
5const title = dom.querySelector("h3")?.textContent.trim();
6const bio = dom.querySelector("#bio1")?.textContent.trim();
githubEventsmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23// GitHub events
4export let githubEvents = fetchJSON(
5"https://api.github.com/users/stevekrouse/events"
6);