1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { fetch } from "https://esm.town/v/std/fetch";
export const getRaycastDownloadCount = (async () => {
const { DOMParser } = await import(
"https://deno.land/x/deno_dom/deno-dom-wasm.ts"
);
const url = "https://www.raycast.com/tailscale/tailscale";
const response = await fetch(url);
const html = await response.text();
const document = new DOMParser().parseFromString(html, "text/html");
const data = await JSON.parse(
document.getElementById("__NEXT_DATA__").textContent
);
return data.props.pageProps.fallback["users/tailscale/extensions/tailscale"]
.download_count;
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023