Search
tanCrane
@frmysantana
An interactive, runnable TypeScript val by frmysantana
HTTP (deprecated)
export default async function tacoBellNutritionScrapper(req) {
const sourceUrl = `https://www.nutritionix.com/taco-bell/menu/premium`;
const siteText = await fetch(sourceUrl);
const $ = cheerio.load(await siteText.text());
const items = $("tr.odd, tr.even").map((i, e) => {
const name = $(e).find(".nmItem").html();
const calories = $(e).find("[aria-label*='Calories']").html();
return { name: name, calories: calories };
}).toArray();
return Response.json({ items });
aquaDamselfly
@nbbaier
@jsxImportSource https://esm.sh/hono@latest/jsx
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
const app = new Hono();
app.get("/", c => {
return c.html(
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.min.js">
</script>
cheerioScraper
@damidina
cheerioScraper This val scrapes a website to extract all the URLs from anchor ( <a> ) tags using the cheerio library. Usage import scrapeWebsite from 'val:damidina.cheerioScraper';
const urls = await scrapeWebsite('https://example.com');
console.log(urls);
Script
# cheerioScraper
This val scrapes a website to extract all the URLs from anchor (`<a>`) tags using the `cheerio` library.
## Usage
```ts
const urls = await scrapeWebsite('https://example.com');
console.log(urls);
const urls = await scrapeWebsite("https://vercel.com");
console.log(urls);
export default async function scrapeWebsite(url: string) {
const response = await fetch(url);
honoJsPyodide
@tfayyaz
@jsxImportSource npm:hono/jsx
HTTP (deprecated)
/** @jsxImportSource npm:hono/jsx **/
const app = new Hono();
const title = "Click Button Demo";
const View = () => {
return (
<html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.js"></script>
</head>
<body>
azureBeetle
@stevekrouse
@jsxImportSource https://esm.sh/hono@latest/jsx
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
export const homepage = (c: Context) => {
return c.html(
<html>
<head>
<title>Will Krouse</title>
<style
dangerouslySetInnerHTML={{
__html:
`:root{--slate1: hsl(200, 7%, 8.8%);--slate2: hsl(195, 7.1%, 11%);--slate3: hsl(197, 6.8%, 13.6%);--slate4: hsl(198, 6.6%, 15.8%);--slate5: hsl(199, 6.4%, 17.9%);--slate6: hsl(201, 6.2%, 20.5%);--slate7: hsl(203, 6%, 24.3%);--slate8: hsl(207, 5.6%, 31.6%);--slate9: hsl(206, 6%, 43.9%);--slate10: hsl(206, 5.2%, 49.5%);--slate11: hsl(206, 6%, 63%);--slate12: hsl(210, 6%, 93%);--blue1: hsl(212, 35%, 9.2%);--blue2: hsl(216, 50%, 11.8%);--blue3: hsl(214, 59.4%, 15.3%);--blue4: hsl(214, 65.8%, 17.9%);--blue5: hsl(213, 71.2%, 20.2%);--blue6: hsl(212, 77.4%, 23.1%);--blue7: hsl(211, 85.1%, 27.4%);--blue8: hsl(211, 89.7%, 34.1%);--blue9: hsl(206, 100%, 50%);--blue10: hsl(209, 100%, 60.6%);--blue11: hsl(210, 100%, 66.1%);--blue12: hsl(206, 98%, 95.8%)}body{font-family:system-ui,sans-serif;margin:auto;padding:20px;max-width:65ch;text-align:left;word-wrap:break-word;overflow-wrap:break-word;line-height:1.5}h1,h2,h3,h4,h5,h6,strong,b{font-weight:500}a{color:var(--blue10)}nav a{margin-right:10px}textarea{width:100%;font-size:16px}input{font-size:16px}content{line-height:1.6}table{width:100%}img{max-width:100%;height:auto}code{padding:2px 5px;background-color:var(--slate4);font-family:menlo,monospace}pre{padding:1rem}pre>code{all:unset}blockquote{border:1px solid var(--slate10);color:var(--slate11);padding:2px 0 2px 20px;margin:0;font-style:italic}a[data-astro-cid-eimmu3lg]{display:inline-block;text-decoration:none}a[data-astro-cid-eimmu3lg].active{font-weight:600;text-decoration:underline}header[data-astro-cid-3ef6ksr2]{margin:0 0 2em}h2[data-astro-cid-3ef6ksr2]{margin:.5em 0}`,
scraper
@pranjaldotdev
An interactive, runnable TypeScript val by pranjaldotdev
Script
const NEWSLETTER_URL = "https://bytes.dev/archives";
function normalizeURL(url: string) {
return url.startsWith("http://") || url.startsWith("https://")
? url
: "http://" + url;
async function fetchText(url: string, options?: any) {
const response = await fetch(normalizeURL(url), {
redirect: "follow",
...(options || {}),
return response.text();
templateModalTest
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP (deprecated)
export default async function (req: Request): Promise<Response> {
const templateModal = `
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="text-black bg-blue-200">
ask_ai_web
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { Hono } from "npm:hono";
const app = new Hono();
helloval
@yusukebe
An interactive, runnable TypeScript val by yusukebe
HTTP (deprecated)
import { Hono } from "npm:hono@4";
const app = new Hono();
app.get("/", (c) => c.text("Hello Val!!!!!!"));
export default app.fetch;
administrativePlumSnipe
@raykooyenga
// import * as http from "npm:http";
Script
// import * as http from "npm:http";
var http = require("node:http");
// var http = require('http');
http.createServer(function(request, response) {
response.writeHead(200);
response.write(JSON.stringify(request.headers));
response.end();
}).listen(8080);
cyanPanther
@yusukebe
An interactive, runnable TypeScript val by yusukebe
HTTP (deprecated)
import { Hono } from "npm:hono@4";
const app = new Hono();
app.get("/", (c) => c.text("Hello Val!!!"));
export default app.fetch;
nodejsInternals
@easrng
An interactive, runnable TypeScript val by easrng
Script
import { __nodejsInternals } from "https://esm.town/v/easrng/__nodejsInternals";
export const nodejsInternals = (o) => __nodejsInternals(o);
v1
@naserdehghan
An interactive, runnable TypeScript val by naserdehghan
HTTP (deprecated)
import { Hono } from "npm:hono@4";
const app = new Hono();
app.get("/", (ctx) => {
return ctx.json({ ok: true });
app.get("about", (ctx) => {
return ctx.text("About US");
export default app.fetch;
honoExample
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP (deprecated)
import { Hono } from "npm:hono"
const app = new Hono()
app.get('/', c => c.text("Hello Hono!"))
export const honoExample = app.fetch
honoHtmxJsTemplate
@tfayyaz
@jsxImportSource npm:hono/jsx
HTTP (deprecated)
/** @jsxImportSource npm:hono/jsx **/
const app = new Hono();
const title = "Click Button Demo";
const View = () => {
return (
<html>
<head>
{html`
<script src="https://unpkg.com/htmx.org@1.9.12/dist/htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS" crossorigin="anonymous"></script>
</head>