A modern weather application that uses Netscape's free weather service, powered by Bun, Express.js, and Ollama AI for data parsing.
- CLI Interface: Interactive command-line weather search with Enquirer prompts
- Web Interface: Beautiful map-based visualization with animated particles
- AI-Powered Parsing: Uses Ollama (llama3.2:1b) to parse weather data into structured JSON
- Smart Caching: File-based cache with 1-hour expiry to minimize API requests
- Particle Animations: Visual weather effects including wind, rain, clouds, temperature, and humidity overlays
Install Ollama and pull the model:
ollama pull llama3.2:1bbun installRun the interactive command-line interface:
bun run cliFeatures:
- Interactive search prompts with Enquirer
- Displays today's weather and forecast
- Color-coded output for better readability
- Cached results for faster subsequent queries
- Selection menu when multiple locations found
Start the web server:
bun run serverThen open http://localhost:3000 in your browser.
Features:
- Interactive map powered by Leaflet and OpenStreetMap
- Search for any location
- Multiple visualization modes:
- Temperature: Red-blue gradient overlay (40°C = red, -5°C = blue)
- Felt Temperature: Same as temperature but uses "feels like" values
- Humidity: Blue-red gradient (0% = blue, 100% = red)
- Wind: Particle animation with trails showing wind speed and direction
- Clouds: Cloud-shaped particles based on cloud coverage
- Automatic caching (max 1 request per location per hour)
- Dark theme optimized for weather visualization
Run individual test files:
# Run all tests (integration)
bun run test:integration
# Test web scraper
bun run test:scraper
# Test AI parser (requires Ollama running)
bun run test:parser
# Test file cache
bun run test:cache.
├── index.js # CLI entry point
├── server.js # Web server entry point
├── package.json # Dependencies
├── src/
│ ├── scraper.js # Netscape weather scraping
│ ├── parser.js # Ollama AI parsing
│ ├── cache.js # File-based caching
│ ├── geocode.js # Location helpers
│ └── public/
│ ├── index.html # Web interface
│ ├── style.css # Styling
│ └── app.js # Frontend logic + particles
├── cache/ # Cache directory (auto-created)
├── test-scraper.js # Scraper tests
├── test-parser.js # Parser tests
└── test-cache.js # Cache tests
Search for locations by name or zip code.
Response:
{
"places": [
{"id": "12838767", "name": "Ilmenau, TH, DE"}
]
}Get weather data for a location.
Response:
{
"locationId": "12838767",
"type": "today",
"data": [
{
"time": "6:00 PM Friday",
"clouds": 1,
"temp": 46,
"humidity": 92,
"felttemp": 45,
"wind": 5,
"winddir": "sse"
}
]
}- Scraping: The app scrapes Netscape's weather pages (https://isp.netscape.com/weather/)
- Parsing: Raw HTML is converted to text and sent to Ollama AI
- Caching: Results are cached locally in JSON files for 1 hour
- Visualization: Frontend uses Canvas API for particle effects and Leaflet for maps
- This app uses Netscape's free weather service which may not be available indefinitely
- The geocoding feature is simplified and may not work for all locations
- Ollama must be running locally for the parser to work
- Cache files are stored in the
./cachedirectory
MIT