1export function myApi(name) {
2 return "hi " + name;
3}
7export async function searchManifoldMarkets(query: string) {
8 const result = await fetch(
9 `https://manifold.markets/api/v0/search-markets?${query}`,
10 );
11 const markets = await result.json() as Market[];
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function tidbytDeviceInfo({ deviceId, apiKey }: {
4 deviceId: string;
5 apiKey: string;
6}) {
7 return fetchJSON(
8 `https://api.tidbyt.com/v0/devices/${deviceId}`,
9 {
10 headers: {
11 Authorization: `Bearer ${apiKey}`,
12 },
13 },
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=michael"
6);
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
8 | "Computer"
9 | "Horde"
10 | "Rapid"
11 | "Atomic"
12 | "Crazyhouse"
30type Games = Record<GameType, Entry>;
31export async function lichessTVGames(): Promise<Games> {
32 const channels = await fetch("https://lichess.org/api/tv/channels");
33 return await channels.json();
34}
5 /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i;
6 const YouTubeKey = {
7 apiKey: "INNERTUBE_API_KEY",
8 serializedShareEntity: "serializedShareEntity",
9 visitorData: "VISITOR_DATA",
94 );
95 const body = await textResponse.text();
96 const apiKey = this.extractValue(body, YouTubeKey.apiKey);
97 if (!apiKey || !apiKey.length) {
98 throw new YoutubeTranscriptError(
99 `Failed to extract ${YouTubeKey.apiKey}`,
100 );
101 }
102 const transcriptResponse = await fetch(
103 `https://www.youtube.com/youtubei/v1/get_transcript?key=${apiKey}`,
104 {
105 method: "POST",
158 }
159 /**
160 * Generate tracking params for YouTube API
161 * @param page
162 * @param config
229 }
230 /**
231 * Generate nonce for clientScreenNonce as part of YouTube API
232 */
233 static generateNonce() {