1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/bramses/events"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let get = () => {
4 var res = fetch("https://tampere.sometec.fi/showSpace03S.php", {
5 credentials: "include",
6 headers: {
11 "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
12 "X-Requested-With": "XMLHttpRequest",
13 "Sec-Fetch-Dest": "empty",
14 "Sec-Fetch-Mode": "cors",
15 "Sec-Fetch-Site": "same-origin",
16 },
17 referrer: "https://tampere.sometec.fi/index.html?sP409100P600P",
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export async function getAppleDevice(req: express.Request, res: express.Response) {
4 const deviceId = req.query.search_keywords as string;
5 const html = await fetchText(
6 `https://everymac.com/ultimate-mac-lookup/?search_keywords=${
7 encodeURI(deviceId)
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let npmExample = (async () => {
4 const ip = await import("npm:image-pixels"); // The Lodash library exported as ES modules.
5 const image = await fetch(
6 "https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png"
7 ).then((r) => console.log(r));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const editVal = (body: {
7 isInterval?: boolean;
8}) =>
9 fetchJSON(`api.val.town/run/`, {
10 headers: {
11 accept: "*/*",
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);
1export let untitled_magentaBaboon = async () => {
2 // const cheerio = await import("npm:cheerio");
3 // const request = await fetch("https://woolworths.com.au");
4 // const $ = cheerio.load(request.body);
5 return new Response(`<h1>Hi!</h1>`, {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const runPostSaveMessage = (async () => {
4 const response = await fetch(
5 "https://chris_symbiote-postSaveMessage.express.val.run",
6 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function tidbytDeviceInstallations({ deviceId, apiKey }: {
5 apiKey: string;
6}) {
7 return fetchJSON(
8 `https://api.tidbyt.com/v0/devices/${deviceId}/installations`,
9 {