Search
Code27
export const fetch_whatsnew = async (): Promise<Article[]> => { const cheerio = await import("npm:cheerio"); const html = await fetch("https://www.jw.org/en/whats-new/").then((res) => res.text()
notify: boolean;}) { const cheerio = await import("npm:cheerio"); const UA_LIST = [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
export const letterboxd = async (username: string) => { const { default: cheerio } = await import("npm:cheerio"); const URL = `https://letterboxd.com/${username}/films/diary/`; const getTotalPages = async () => {
export async function exchangeRate() { const cheerio = await import("npm:cheerio"); const page = await fetch( "https://kur.doviz.com/serbest-piyasa/amerikan-dolari",
export const webscrapeWikipediaIntro = (async () => { const cheerio = await import("npm:cheerio"); const html = await fetchText( "https://en.wikipedia.org/wiki/OpenAI",
matches({ type: "webpage" }), async () => { await import("npm:cheerio"); const { CheerioWebBaseLoader } = await import( "npm:langchain/document_loaders/web/cheerio"
"npm:langchain/agents" ); const cheerio = await import("npm:cheerio"); const { LLMChain } = await import("npm:langchain/chains"); const { ChatPromptTemplate, HumanMessagePromptTemplate } = await import(
export const getTideTimes = (async () => { const cheerio = await import("npm:cheerio"); const response = await fetch( "https://www.worldtides.info/tidestations/Europe/Ireland/DUBLIN_(NORTH_WALL)",
export let cheerioExample = (async () => { const { default: $ } = await import("npm:cheerio"); const document = $(`<article> <div>Hello</div>
const sourceUrl = "https://assine.bibliotecacatolica.com.br/edicoes-anteriores"; const { default: cheerio } = await import("npm:cheerio"); const html = await fetchText(sourceUrl); console.log(cheerio);
Vals
No vals found
Users
No users found
Importing. Copy page Copy page. Copy this page as Markdown for LLMs. View as Markdown View this page as plain text. Open in ChatGPT Ask questions about this page. One
the val’s name. Imports & pinning. Section titled “Imports & pinning” Vals are imported via esm.town URLs. If you leave off the version number, it’s an unpinned import, and you’ll
file. Example: import { isMain } from "https://esm.town/v/std/utils/index.ts"; if (isMain(import.meta.url)) { console.log("This file is being run directly"); // Run main logic here. } else { console.log("This file is being imported");
will be preserved. Imports. Section titled “Imports” Imports via esm.town will still point to previous versions unless updated manually. Relative imports are converted automatically to absolute imports. import.meta.url. Section titled
Val Town ↗ import { sqlite } from "https://esm.town/v/std/sqlite"; const data = await sqlite.execute("SELECT datetime();"); console.log(data.rows[0]); Basic usage. Section titled “Basic usage” Basic usageRun in Val Town ↗ import {
Usage of @vtdocs/getGithubUserRun in Val Town ↗ import { getGithubUser } from "https://esm.town/v/vtdocs/getGithubUser"; console.log(await getGithubUser("stevekrouse")); You can also do this with octokit.js. Reminder: import npm packages by prepending the package
Val Town ↗ import { email } from "https://esm.town/v/std/email?v=9"; import { msMinute } from "https://esm.town/v/stevekrouse/msMinute?v=1"; import { msAgo } from "https://esm.town/v/rodrigotello/msAgo?v=2"; import { githubPatToken } from "https://esm.town/v/vtdocs/githubPatToken"; import { fetchJSON
Town! ExampleRun in Val Town ↗ import { sqlite } from "https://esm.town/v/std/sqlite"; import { sql } from "npm:drizzle-orm"; import { drizzle } from "npm:drizzle-orm/libsql"; import { integer, sqliteTable, text }
Val Town ↗ import { gpt3 } from "https://esm.town/v/patrickjm/gpt3?v=4"; export let librarySecret = gpt3({ prompt: "what is the meaning of life?", openAiKey: Deno.env.get("openai"), }); Import security. If you’re importing someone
Get JSON import { blob } from "https://esm.town/v/std/blob"; let blobDemo = await blob.getJSON("myKey"); console.log(blobDemo); // returns `undefined` if not found. Set JSON. Section titled “Set JSON” Set JSON import {