106console.log(result.rows[0]);
107
108// Blob storage API
109import { blob } from "https://esm.town/v/std/blob";
110const key = "blob_test";
2526export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
27fetchJSON("https://accounts.spotify.com/api/token", {
28method: "POST",
29body: querystring({
3940export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
41fetch("https://accounts.spotify.com/api/token", {
42method: "POST",
43body: new URLSearchParams({
191192try {
193const currentlyPlaying = await fetch("https://api.spotify.com/v1/me/player/currently-playing", {
194method: "GET",
195headers: {
207208if (!mostRecentTrack) {
209const recentTracks = await fetch("https://api.spotify.com/v1/me/player/recently-played", {
210method: "GET",
211headers: {
232233try {
234const playStateResponse = await fetch("https://api.spotify.com/v1/me/player?market=US", {
235method: "GET",
236headers: {
twitterSearchmain.tsx1 match
14}): Promise<TweetResult[]> {
15const res = await twitterJSON({
16url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17{
18query,
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