Search

Results include substring matches and semantically similar vals. Learn more
frmysantana avatar
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 });
nbbaier avatar
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>
damidina avatar
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);
tfayyaz avatar
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>
stevekrouse avatar
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
pranjaldotdev avatar
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();
iamseeley avatar
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">
pomdtr avatar
ask_ai_web
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { Hono } from "npm:hono";
const app = new Hono();
yusukebe avatar
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;
raykooyenga avatar
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);
yusukebe avatar
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;
easrng avatar
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);
naserdehghan avatar
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;
stevekrouse avatar
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
tfayyaz avatar
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+YGgN3U4V4ZncZ0BvU
</head>