2import ValTown from "npm:@valtown/sdk";
3
4async function getMyValId(importMetaURL: string) {
5 const vt = new ValTown();
6 const { author, name } = extractValInfo(importMetaURL);
1# getMyValId
2
3Helper function for a val to get its own ID.
4
5## Usage
1import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
2
3export default async function scrapeBookMyShow() {
4 const url = "https://in.bookmyshow.com/explore/home/mumbai"; // Example URL, you may need to adjust this
5 const response = await fetch(url, {
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
7} from "https://raw.githubusercontent.com/Ciarands/mw-providers/dev/src/providers/sources/primewire/common.ts";
8
9async function search(imdbId: string) {
10 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
11 return await searchResult.json().then((searchResult) => {
14}
15
16async function getStreams(title: string) {
17 const titlePage = load(title);
18 const userData = titlePage("#user-data").attr("v");
53}
54
55export async function scrapeMovie(imdbId) {
56 const searchResult = await search(imdbId);
57
64 };
65}
66export async function scrapeShow(imdbId, seasonId, episodeId) {
67 console.log(imdbId, seasonId, episodeId);
68 if (!imdbId) throw new Error("No imdbId provided");
6);
7
8export async function uptimeCheck(url: string) {
9 let reason: string, status: number, end: number;
10 let ok = true;
213
214 if (toolResults && toolResults.length > 0) {
215 // we have to do this bc the AI SDK doesn't seem to let you carry over function calling results,
216 // so we pretend to be the user instead of using the official role: tool API, which breaks everything
217 for (const toolResult of toolResults) {
670}
671
672function test() {
673 console.log("test!")
674}
4import { fetchJSON } from "https://esm.town/v/panphora/fetchJSON";
5
6export default async function(interval: Interval) {
7 const lastBtcPrice = await blob.getJSON("lastBtcPrice") || 0;
8
1export default async function(req: Request): Promise<Response> {
2 // Setup CORS Headers
3 const headers = new Headers();
144};
145
146function App() {
147 const [tareasCompletadas, setTareasCompletadas] = useState([]);
148 const [estadosTemporizador, setEstadosTemporizador] = useState(tareasRutinarias.map(tarea => ({
163 };
164
165 function disparar(proporcionParticulas, opciones) {
166 confetti({
167 ...configuracionPredeterminada,
377}
378
379function client() {
380 createRoot(document.getElementById("root")).render(<App />);
381}
382if (typeof document !== "undefined") { client(); }
383
384async function server(request: Request): Promise<Response> {
385 return new Response(
386 `
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",