68return rateLimitService.executeWithRateLimit(routeKey, async () => {
69console.log(`🔄 Sending request to ${url}`);
70const response = await fetch(url, {
71...options,
72headers,
2829console.log(`🔄 Sending request to ${url}`);
30const response = await fetch(url, {
31...options,
32headers,
luciaMagicLinkStarterindex.ts2 matches
24});
2526// HTTP vals expect an exported "fetch handler"
27// This is how you "run the server" in Val Town with Hono
28export default app.fetch;
66return rateLimitService.executeWithRateLimit(routeKey, async () => {
67console.log(`🔄 Sending request to ${url}`);
68const response = await fetch(url, {
69...options,
70headers,
109const token = Deno.env.get("DISCORD_BOT_TOKEN");
110111const response = await fetch(url, {
112method: "PUT",
113headers: {
crypto-geminiscript.tsx11 matches
2// Make sure to set the COINGECKO_API_KEY environment variable in Val Town
34import { fetch } from "npm:undici"; // Use undici for fetch in Node.js environment
56interface CoinGeckoMarketCoin {
57const FNG_API_URL = "https://api.alternative.me/fng/?limit=1";
5859async function fetchFromApi<T>(url: string, isCoinGecko: boolean = true): Promise<T | null> {
60const headers: HeadersInit = {};
61if (isCoinGecko && COINGECKO_API_KEY) {
6566try {
67const response = await fetch(url, { headers });
68if (!response.ok) {
69const errorText = await response.text();
73return await response.json() as T;
74} catch (error) {
75console.error(`Network or Fetch Error for ${url}: `, error);
76return null;
77}
100topCoinsData,
101] = await Promise.all([
102fetchFromApi<CoinGeckoMarketCoin[]>(`${COINGECKO_API_BASE}/coins/markets?vs_currency=usd&ids=bitcoin`),
103fetchFromApi<CoinGeckoChartData>(
104`${COINGECKO_API_BASE}/coins/bitcoin/market_chart?vs_currency=usd&days=30&interval=daily`,
105),
106fetchFromApi<FearAndGreedData>(FNG_API_URL, false), // false for isCoinGecko
107fetchFromApi<CoinGeckoGlobalData>(`${COINGECKO_API_BASE}/global`),
108fetchFromApi<CoinGeckoMarketCoin[]>(
109`${COINGECKO_API_BASE}/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=10&page=1&sparkline=true&price_change_percentage=7d`,
110),
124});
125} catch (error) {
126console.error("Error fetching dashboard data:", error);
127return new Response(JSON.stringify({ error: "Failed to fetch dashboard data" }), {
128headers: { ...corsHeaders, "Content-Type": "application/json" },
129status: 500,
dood-redirectmain.tsx1 match
16});
1718export default app.fetch;
mastodon-pogodanew-file-2457.tsx4 matches
1const mastodonToken = Deno.env.get("MASTODON_ACCESS_TOKEN");
23import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4import { load } from "npm:cheerio";
56async function mastodonWeatherMap() {
7const html = await fetchText("https://www.bankier.pl//gielda/notowania/indeksy-gpw"); // Przykład linku do strony z ETF-ami
8const $ = load(html);
936const status = await mastodonWeatherMap();
3738const html = await fetchText(
39"https://www.bankier.pl//gielda/notowania/indeksy-gpw",
40);
47console.log("lol");
4849await fetch(`https://mastodon.social/api/v1/statuses`, {
50method: "POST",
51headers: {
hn-remote-ts-genai-jobsindex.ts7 matches
4* This script:
5* 1. Finds the latest "Who's Hiring" thread on Hacker News
6* 2. Fetches all comments from that thread
7* 3. Filters for remote jobs requiring TypeScript and GenAI skills
8* 4. Formats and outputs the results
14import {
15findLatestWhoIsHiringThread,
16fetchComments,
17getFallbackThreadId
18} from "./hackerNewsApi.ts";
2627/**
28* Main function to fetch and process job listings
29*/
30export async function findRemoteTSGenAIJobs(): Promise<{
46}
47
48console.log("📥 Fetching comments...");
49const comments = await fetchComments(threadId);
50console.log(`✅ Fetched ${comments.length} comments`);
51
52console.log("🔎 Filtering for remote TS+GenAI jobs...");
99return await blob.getJSON(`${STORAGE_KEY}-latest`);
100} catch (error) {
101console.error("Error fetching latest results:", error);
102return null;
103}
hn-remote-ts-genai-jobshackerNewsApi.ts13 matches
2425/**
26* Fetches a Hacker News item by its ID
27* @param id The Hacker News item ID
28* @returns The item data or null if not found
29*/
30export async function fetchItem(id: number): Promise<HNItem | null> {
31try {
32const response = await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`);
33if (!response.ok) {
34throw new Error(`Failed to fetch item ${id}: ${response.status}`);
35}
36return await response.json();
37} catch (error) {
38console.error(`Error fetching item ${id}:`, error);
39return null;
40}
4243/**
44* Fetches all comments from a Hacker News thread
45* @param storyId The parent story/thread ID
46* @returns An array of comment items
47*/
48export async function fetchComments(storyId: number): Promise<HNItem[]> {
49const story = await fetchItem(storyId);
50if (!story || !story.kids || story.kids.length === 0) {
51return [];
52}
5354// Fetch all comments in parallel
55const commentPromises = story.kids.map(kid => fetchItem(kid));
56const comments = await Promise.all(commentPromises);
57
72try {
73// First get the user information for "whoishiring" account
74const whoishiringUserInfo = await fetch('https://hacker-news.firebaseio.com/v0/user/whoishiring.json');
75const userInfo = await whoishiringUserInfo.json();
76
82const recentSubmissions = userInfo.submitted.slice(0, 10);
83
84// Fetch details for each submission
85const submissionPromises = recentSubmissions.map(id => fetchItem(id));
86const submissions = await Promise.all(submissionPromises);
87
hn-remote-ts-genai-jobsREADME.md2 matches
1# Hacker News Remote TypeScript & GenAI Jobs Filter
23This Val Town project fetches the latest "Who's Hiring" thread from Hacker News and filters the comments to find remote job opportunities that require TypeScript and GenAI (Generative AI) skills.
45## How It Works
671. Fetches the latest "Who's Hiring" thread ID from Hacker News
82. Retrieves all comments from that thread
93. Filters comments to find remote job postings that mention TypeScript and GenAI