UNPKG

realtime-data-cli-tool

Version:

A real-time data dashboard CLI tool built with Ink, React, and TypeScript that displays live ISS location, weather, Bitcoin prices, random facts, and inspirational quotes

23 lines (22 loc) 840 B
export const fetchWeatherData = async () => { try { // Using a fallback since API key is needed const fallbackWeather = { location: 'San Francisco', temperature: Math.floor(Math.random() * 20) + 10, description: ['Sunny', 'Cloudy', 'Rainy', 'Foggy'][Math.floor(Math.random() * 4)], humidity: Math.floor(Math.random() * 40) + 30, }; return fallbackWeather; } catch (error) { // Fallback weather data const fallbackWeather = { location: 'San Francisco', temperature: Math.floor(Math.random() * 20) + 10, description: ['Sunny', 'Cloudy', 'Rainy', 'Foggy'][Math.floor(Math.random() * 4)], humidity: Math.floor(Math.random() * 40) + 30, }; return fallbackWeather; } };