1import { fetch } from "https://esm.town/v/std/fetch";
2
3function fetchJSON(url) {
4 return fetch(url).then(res => res.json());
5}
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "eth");
17
18 <script>
19 async function main() {
20 let pyodide = await loadPyodide();
21 console.log('Pyodide is ready to use!');
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4
5export default async function(interval: Interval) {
6 const lastLakeTemp = await blob.getJSON("lastLakeTemp");
7 const temperature = await getLakeTemp();
43}
44
45export async function getLakeTemp() {
46 const result = await fetchText("https://www.omniafishing.com/w/candlewood-lake-3-fishing-reports/current-conditions");
47 const temperature = result.match(/<strong>([0-9]+)/)[1];
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4
5export default async function(interval: Interval) {
6 const lastLakeTemp = await blob.getJSON("lastLakeTemp");
7 const temperature = await getLakeTemp();
43}
44
45export async function getLakeTemp() {
46 const result = await fetchText("https://www.omniafishing.com/w/candlewood-lake-3-fishing-reports/current-conditions");
47 const temperature = result.match(/<strong>([0-9]+)/)[1];
1export async function handle() {
2 // Schedule work to do later
3 (async () => {
1import cheerio from "npm:cheerio";
2
3export default async function tacoBellNutritionScrapper(req) {
4 const sourceUrl = `https://www.nutritionix.com/taco-bell/menu/premium`;
5 const siteText = await fetch(sourceUrl);
1export async function handle() {
2 // Schedule work to do later
3 (async () => {
3import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds";
4
5export async function pollRSSFeeds({ lastRunAt }: Interval) {
6 return Promise.all(
7 Object.entries(rssFeeds).map(async ([name, url]) => {
1export default async function handler(req: Request): Promise<Response> {
2
3
Simple functional CSS library for Val Town
A helper function to build a file's email
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.