twitterSearchmain.tsx1 match
14}): Promise<TweetResult[]> {
15const res = await twitterJSON({
16url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17{
18query,
3Get the Air Quality Index (AQI) for a location via open data sources.
45It's "easy" because it strings together multiple lower-level APIs to give you a simple interface for AQI.
671. Accepts a location in basically any string format (ie "downtown manhattan")
17}
1819const resp = await fetch("https://api.pushover.net/1/messages.json", {
20headers: {
21"Content-Type": "application/json",
randomCardImagemain.tsx1 match
4try {
5const response = await fetch(
6"https://deckofcardsapi.com/api/deck/new/draw/?count=1",
7);
8const data = await response.json();
35const { id } = c.req.param();
36const post_data = `fid=${id.split(".")[1]}&share_key=${id.split(".")[0]}`;
37const streamApiRequest = await fetch(`https://www.febbox.com/file/player?${post_data}`, {
38method: "POST",
39headers: headers,
40});
41const urlResponse = await streamApiRequest.text();
42console.log(urlResponse);
43const regex = /\{"type":(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/g;
69const _tv = (type === "S") ? `.${season}.1` : "";
70console.log(_tv);
71const idApiRequest = await fetch(`https://api.dmdb.network/v1/gmid/${type}.${tmdb}${_tv}`);
72const idApiJson = await idApiRequest.json();
73console.log(idApiJson);
74if (idApiRequest.status === 404 || idApiJson["ids"].length === 0) {
75return c.json([]);
76}
7778const mode = type === "M" ? 1 : 2;
79const sheguId = idApiJson["ids"]["superstream"];
80const showbox = await fetch(`https://www.showbox.media/index/share_link?id=${sheguId}&type=${mode}`, {
81headers: headers,
92? await scrapeSeriesFiles(febboxItemJson, febboxId, season, episode)
93: await scrapeMoviesFiles(febboxItemJson, febboxId);
94const apiResponse = {
95id: "",
96type: "SERIES",
99for (const item of febboxFiles.data.file_list) {
100if (item.file_icon === "video_icon")
101apiResponse.media.push({
102id: `${febboxId}.${item.fid}`,
103name: item.file_name,
110});
111}
112return c.json(apiResponse);
113});
114async function scrapeMoviesFiles(directoryList, febboxId: string) {
1import { GoogleGenerativeAI } from "npm:@google/generative-ai";
2export default async function(req: Request): Promise<Response> {
3const genAI = new GoogleGenerativeAI(Deno.env.get("your-api-key"));
4const generativeModel = genAI.getGenerativeModel({
5model: "gemini-1.5-flash-001",
5**Prerequisite:**
67Follow Google's [Getting Started guide](https://ai.google.dev/gemini-api/docs/get-started/tutorial?lang=node) to get an API key and view some example methods.
89Migrated from folder: Utilities/googleGenerativeAIStreamingExample
servicefactorymain.tsx2 matches
62* Indicates that the input or output port represents base structured
63* datatype containing multi-part content of a message, generated by an LLM.
64* See [Content](https://ai.google.dev/api/rest/v1beta/Content) for details
65* on the datatype.
66*/
242if (!inputs.$key || inputs.$key != Deno.env.get("BB_SERVICE_KEY")) {
243return Response.json({
244$error: "Must provide an API key to access the service.",
245});
246}
openAiProxymain.tsx1 match
10export default async function(req: Request): Promise<Response> {
11// Handle POST request
12// This is the primary path for the API
13if (req.method === "POST") {
14const { prompt } = await req.json();
openAiProxyREADME.md2 matches
3## Overview
45This val is a proxy server that interacts with the OpenAI API to generate responses based on prompts in the request body. The function handles incoming HTTP POST requests, processes the prompt, and returns a response generated by the LLM.
67## Prerequisites
89- Server-side: (Optional) An active OpenAI API key
10- Client-side: Something that can make POST requests (browser code, Postman, cURL, another Val, etc)
11