reflectiveBrownCowmain.tsx11 matches
332333const css = `
334@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');
335336:root {
664async function server(request: Request): Promise<Response> {
665if (request.method === "POST" && new URL(request.url).pathname === "/generate-training") {
666const YOUTUBE_API_KEY = Deno.env.get("YOUTUBE_API_KEY2");
667const useApiKey = YOUTUBE_API_KEY !== undefined && YOUTUBE_API_KEY !== "";
668if (!YOUTUBE_API_KEY) {
669console.warn("YouTube API key (YOUTUBE_API_KEY2) is not set. Falling back to search URL method.");
670}
671722for (const placeholder of videoPlaceholders) {
723const searchQuery = placeholder.replace('[VIDEO: ', '').replace(']', '');
724const videoId = await getYouTubeVideoId(searchQuery, sport, YOUTUBE_API_KEY);
725if (videoId) {
726const embedHtml = `
805}
806807async function getYouTubeVideoId(query, sport, apiKey, useApiKey = true) {
808if (useApiKey) {
809try {
810const searchUrl = `https://www.googleapis.com/youtube/v3/search?part=snippet&q=${encodeURIComponent(sport + ' ' + query)}&key=${apiKey}&type=video&maxResults=1`;
811const response = await fetch(searchUrl);
812const data = await response.json();
813if (data.error) {
814console.warn("YouTube API error:", data.error.message);
815return getFallbackYouTubeLink(query, sport);
816}
819}
820} catch (error) {
821console.error("Error fetching from YouTube API:", error);
822}
823}
exceptionalBrownWolfmain.tsx1 match
78const css = `
9@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');
1011:root {
yuktiVoiceAssistantmain.tsx1 match
224const openai = new OpenAI({
225// Add any necessary configuration if required
226// For example: apiKey might be needed depending on the library version
227});
228
275}
276277// Preferred method: Clipboard API
278if (navigator.clipboard) {
279navigator.clipboard.writeText(sequence)
fantasticPinkCougarmain.tsx1 match
12try {
13const response = await fetch(
14`https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
15);
16const data = await response.json();
dreamyYellowFleamain.tsx1 match
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
8return response.json();
9const getForecast = async () => {
10const forecastData = await fetchJSON(
11`http://dataservice.accuweather.com/forecasts/v1/daily/1day/${accuweatherCityCode}?apikey=${process.env.accuWeather}&details=true&metric=true`,
12);
13return forecastData.DailyForecasts[0];
searchSectorsAppmain.tsx10 matches
35
36try {
37const response = await fetch(`/api/search?postcode=${postcode}§or=${sector}`);
38
39if (!response.ok) {
249250export default async function server(request: Request): Promise<Response> {
251// Get API key from environment variables
252const API_KEY = Deno.env.get('BUSINESS_SEARCH_API_KEY');
253254// Check if it's an API request
255const url = new URL(request.url);
256if (url.pathname === '/api/search') {
257const postcode = url.searchParams.get('postcode') || '';
258const sector = url.searchParams.get('sector') || '';
259260try {
261// Use a business directory API (Replace with actual API)
262const apiResponse = await fetch(`https://api.example.com/businesses?postcode=${postcode}§or=${sector}`, {
263headers: {
264'Authorization': `Bearer ${API_KEY}`,
265'Content-Type': 'application/json'
266}
267});
268269if (!apiResponse.ok) {
270throw new Error('Failed to fetch businesses');
271}
272273const data = await apiResponse.json();
274275return new Response(JSON.stringify({
dns_record_debuggerREADME.md1 match
11subject to caching. It'd be an improvement to this tool if we
12could add an uncached DNS check in here. In a couple min I wasn't
13able to find a free DNS checker API. Pull requests welcome!
2728/**
29* Create a secure hash of an email using Web Crypto API
30* @param email User's email address
31* @returns Hexadecimal hash string
65const currentTime = Math.floor(Date.now() / 30000);
6667// Generate a simple time-based code using Web Crypto API
68const encoder = new TextEncoder();
69const data = encoder.encode(secret + currentTime);