Scootercam

How Scootercam gets its data

Most of Scootercam’s data comes from data broker Visual Crossing. Visual Crossing collects its weather data from a blend of national meteorological services, global forecast models, radar and satellite sources, and a network of local weather stations. The platform then merges and normalizes these feeds to provide both historical and forecast data at fine spatial and temporal resolution. When Visual Crossing receives Scootercam’s query, it replies with a seemingly-endless JSON file. This is structured and contains thousands of little datapoints, like the expected high temp three days from now. Other scripts will find that number when they need it.

The JSON output is typically structured with a locations object containing one or more values arraysβ€”each item representing an hourly or daily record with fields like datetime, temp, humidity, windspeed, precip, and weather condition codes or descriptions. A small portion is shown here.

{
  "locations": {
    "Fennville,MI,US": {
      "stationContributions": [],
      "values": [
        {
          "datetime": "2025-10-22",
          "datetimeEpoch": 1761110400,
          "tempmax": 17.2,
          "tempmin": 9.3,
          "temp": 13.1,
          "feelslikemax": 17.2,
          "feelslikemin": 8.7,
          "humidity": 72.1,
          "precip": 1.2,
          "preciptype": ["rain"],
          "windspeed": 14.4,
          "winddir": 238,
          "cloudcover": 68,
          "conditions": "Rain, Partially cloudy",
          "description": "Partly cloudy throughout the day with periods of rain.",
          "icon": "rain",
          "sunrise": "07:59:00",
          "sunset": "18:54:00"
        }
      ],
      "id": "Fennville,MI,US",
      "latitude": 42.5931,
      "longitude": -86.1048,
      "address": "Fennville, MI, United States",
      "timezone": "America/Detroit",
      "tzoffset": -4.0
    }
  }
}

Other chunks of code can take care of sorting through this mess – we just have to make sure the file updates when it needs to.

OK, Now what?

In the old do-it-yourself system, CRON scripts ran every 2 minutes to do this. Not all web hosts allow you to run CRON jobs, especially every 2 minutes. The solution is to have another service run a script every 2 minutes, and that script tells our scripts to run.

Sound complicated?

Maybe not! This should be a turnkey solution. As long as there’s a scootercam.net capable of receiving a little ping, this will work. Without delay, here’s

ScooterCam Weather & Moon Phase System

A reliable, portable, easy-to-maintain data update system


πŸ“¦ What’s in This Package

This is a complete cron-free update system for both weather and moon phase data, designed for low-traffic sites with maximum portability and ease-of-use.

Weather System Files (Updates every 5 minutes)

  • wx-update.php – Secure webhook endpoint for weather updates
  • wx-status.php – Visual monitoring dashboard (weather only)
  • api-get-viscross.php – Your existing weather data fetcher (no changes needed)

Moon Phase System Files (Updates hourly)

  • moon-update.php – Secure webhook endpoint for moon phase updates
  • api-get-moon.php – Moon phase data fetcher
  • wx-status-combined.php – Enhanced dashboard showing both weather AND moon data

Diagnostic Tools

  • wx-install-check.php – One-time installation diagnostic (delete after setup)

Documentation

  • START-HERE.md – Overview and quick start guide
  • SETUP-CHECKLIST.md – Step-by-step setup checklist (weather)
  • MOON-SETUP.md – Step-by-step setup for moon phase system
  • ARCHITECTURE.md – Visual system diagrams and architecture
  • README.md – This file

🎯 What This Solves

Your Old System (Cron-Based)

Server Cron β†’ Runs scripts every X minutes
              ↓
         Problems:
         ❌ Requires SSH/terminal access
         ❌ Doesn't work on low-traffic sites (WordPress cron)
         ❌ Hard to move between hosting providers
         ❌ Fails silently without notifications
         ❌ Difficult for non-technical users to manage

Your New System (Webhook-Based)

Cron-Job.org (external) β†’ Calls your webhook URLs
                           ↓
                   wx-update.php or moon-update.php
                           ↓
                   Runs your data fetchers
                           ↓
                   Updates JSON files
                           ↓
         Benefits:
         βœ… Works on ANY hosting provider
         βœ… Works on low-traffic sites
         βœ… Easy to move between hosts
         βœ… Email alerts when failures occur
         βœ… Visual monitoring dashboard
         βœ… Anyone can manage it
         βœ… Completely FREE!

πŸš€ Quick Start

Which System Do You Want?

Option 1: Weather Only (5 minutes) β†’ Follow SETUP-CHECKLIST.md

Option 2: Weather + Moon Phase (10 minutes) β†’ Follow SETUP-CHECKLIST.md first, then MOON-SETUP.md

Option 3: Just Want to Understand Everything β†’ Read START-HERE.md for complete overview


πŸ“Š System Overview

Weather System (Every 5 Minutes)

Cron-Job.org
    ↓ (calls every 5 min)
wx-update.php (verifies token)
    ↓
api-get-viscross.php (fetches from Visual Crossing API)
    ↓
/wx/*.json files updated
    ↓
Your WordPress plugins display fresh data

Moon Phase System (Every Hour)

Cron-Job.org
    ↓ (calls every hour)
moon-update.php (verifies token)
    ↓
api-get-moon.php (fetches from RapidAPI)
    ↓
/wx/moon_api_data.json updated
    ↓
Your site displays current moon phase

Both Systems Are:

  • βœ… Independent (separate tokens, separate schedules)
  • βœ… Monitored (email alerts for failures)
  • βœ… Logged (activity logs in /wx/ directory)
  • βœ… Portable (works on any hosting provider)

🎨 Key Features

1. External Monitoring (No Server Cron!)

  • Uses Cron-Job.org (free service, no credit card)
  • Calls your webhooks at scheduled intervals
  • Sends email alerts if updates fail
  • Works on ALL hosting providers (shared, VPS, cloud)

2. Security

  • Token-based authentication (separate tokens for each system)
  • Protected endpoints (401/403 errors for unauthorized access)
  • Activity logging for audit trail
  • Easy to rotate credentials

3. Visual Monitoring

  • wx-status.php – Weather data dashboard
  • wx-status-combined.php – Combined weather + moon dashboard
  • Color-coded health indicators (green/yellow/red)
  • Shows last update times for all files
  • Mobile-friendly responsive design

4. Error Handling & Logging

  • Graceful failures (old data remains if API fails)
  • Detailed error logging in /wx/ directory
  • Clear error messages in responses
  • Email notifications via Cron-Job.org

5. Zero Maintenance

  • Set it and forget it
  • Automatic updates at scheduled intervals
  • Email alerts only when issues occur
  • No manual intervention needed

πŸ“‹ What You Get After Setup

Weather System:

  • Weather data updates automatically every 5 minutes
  • Files created/updated in /wx/ directory:
    • current.json – Current conditions
    • hourly.json – 48-hour forecast
    • daily.json – 7-day forecast
    • alerts.json – Weather alerts
    • summary.json – Compact summary
    • weather.json – Combined data
    • weather_table.php – HTML table
    • raw_weather.json – API backup

Moon Phase System (Optional):

  • Moon phase data updates automatically every hour
  • File created/updated: /wx/moon_api_data.json

Monitoring:

  • Status dashboard at: scootercam.net/wx-status.php (or wx-status-combined.php)
  • Activity logs: /wx/webhook.log and /wx/moon-webhook.log
  • Email alerts from Cron-Job.org if failures occur

πŸ”§ Technical Details

System Requirements

  • PHP: 7.0 or higher (you already have this)
  • Web hosting: Any provider with file access (FTP/cPanel)
  • Server access needed: None! (that’s the point!)
  • WordPress required: No (works with or without)
  • Database required: No

API Services Used

  • Visual Crossing Weather API – Weather data (1000 free calls/day)
  • RapidAPI Moon Phase – Moon phase data (your existing subscription)
  • Cron-Job.org – Scheduling service (free tier is sufficient)

File Paths

All files should be in your website root (public_html):

public_html/
β”œβ”€β”€ api-get-viscross.php    (your existing weather script)
β”œβ”€β”€ api-get-moon.php        (your existing moon script)
β”œβ”€β”€ wx-update.php           (NEW - weather webhook)
β”œβ”€β”€ moon-update.php         (NEW - moon webhook)
β”œβ”€β”€ wx-status.php           (NEW - status dashboard)
β”œβ”€β”€ wx-status-combined.php  (NEW - combined dashboard)
└── wx/                     (directory for data files)
    β”œβ”€β”€ current.json
    β”œβ”€β”€ hourly.json
    β”œβ”€β”€ daily.json
    β”œβ”€β”€ alerts.json
    β”œβ”€β”€ summary.json
    β”œβ”€β”€ weather.json
    β”œβ”€β”€ weather_table.php
    β”œβ”€β”€ raw_weather.json
    β”œβ”€β”€ moon_api_data.json
    β”œβ”€β”€ webhook.log
    └── moon-webhook.log

πŸ” Security

Two Independent Systems = Two Separate Tokens

Weather Token (for wx-update.php):

  • Used to call weather webhook
  • Should be different from moon token
  • Change every 6 months

Moon Token (for moon-update.php):

  • Used to call moon phase webhook
  • Should be different from weather token
  • Change every 6 months

Security Best Practices

  • βœ… Use strong random tokens (20+ characters)
  • βœ… Never commit tokens to version control
  • βœ… Store tokens in password manager
  • βœ… Don’t share tokens in support requests
  • βœ… Delete wx-install-check.php after setup
  • βœ… Monitor /wx/*.log files for suspicious activity

πŸ“ˆ Update Schedules

Weather: Every 5 Minutes

  • Why? Weather changes frequently, especially during storms
  • API usage: ~8,640 calls/month (well under 30,000/month limit)
  • Data freshness: Always current

Moon Phase: Every Hour

  • Why? Moon phase changes very slowly
  • API usage: ~720 calls/month
  • Data freshness: More than sufficient

Can I Change These?

Yes! Edit your Cron-Job.org schedules:

  • Weather: Can go up to every 1 minute (but wastes API calls)
  • Moon: Could update every 6-12 hours (moon barely changes)

πŸ†˜ Troubleshooting Quick Reference

Weather Not Updating?

  1. Check scootercam.net/wx-status.php – Are files stale?
  2. Check Cron-Job.org dashboard – Is job enabled and running?
  3. Test manually: scootercam.net/wx-update.php?token=YOUR_TOKEN
  4. Check /wx/webhook.log for error messages

Moon Phase Not Updating?

  1. Check scootercam.net/wx-status-combined.php – Is moon data stale?
  2. Check Cron-Job.org dashboard – Is moon job enabled?
  3. Test manually: scootercam.net/moon-update.php?token=YOUR_MOON_TOKEN
  4. Check /wx/moon-webhook.log for error messages

“Unauthorized” or “Forbidden” Errors?

  • Token mismatch – verify token in PHP file matches token in URL
  • Check for extra spaces or quotes in token

Still Stuck?

  • Read ARCHITECTURE.md for system diagrams
  • Check Cron-Job.org execution history
  • Verify file permissions on /wx/ directory (should be writable)
  • Contact your hosting provider if file write issues persist

🚚 Migration to New Hosting

Moving to a new provider? Easy!

What to Do:

  1. Download all files from old host:
    • All .php files
    • Everything in /wx/ directory
  2. Upload to new host (same directory structure)
  3. Update Cron-Job.org URLs:
    • Change domain in both weather and moon job URLs
    • Keep the same tokens
  4. Test both webhooks manually
  5. Done! Everything continues working

No Configuration Changes Needed!

The system is completely portable – tokens stay the same, file paths are relative, everything just works.


πŸ“ž Support & Documentation

For Setup:

  • SETUP-CHECKLIST.md – Weather system setup (5 minutes)
  • MOON-SETUP.md – Moon phase system setup (5 minutes)
  • START-HERE.md – Complete overview

For Understanding:

  • ARCHITECTURE.md – Visual diagrams and flow charts
  • This README – Technical details and reference

For Maintenance:

  • Monitor: scootercam.net/wx-status.php or wx-status-combined.php
  • Logs: /wx/webhook.log and /wx/moon-webhook.log
  • Service: https://cron-job.org dashboard

✨ What Makes This System Great

For You (Site Owner):

  • βœ… Set it and forget it – No manual updates needed
  • βœ… Email alerts – Know immediately if something breaks
  • βœ… Visual dashboard – See system health at a glance
  • βœ… Portable – Easy to move between hosting providers
  • βœ… Free – No additional costs beyond your existing APIs

For Future Maintainers:

  • βœ… Comprehensive docs – Everything is explained clearly
  • βœ… Simple architecture – Easy to understand, few moving parts
  • βœ… No special skills needed – Anyone can monitor and maintain
  • βœ… Self-diagnosing – Status page shows what’s wrong
  • βœ… Quick recovery – Most issues fixed in under 5 minutes

For Reliability:

  • βœ… External monitoring – Not dependent on your server
  • βœ… Multiple monitoring points – Dashboard, logs, emails
  • βœ… Graceful degradation – Old data remains if API fails
  • βœ… Automatic retry – Service retries if temporary failure
  • βœ… Independent systems – Weather and moon operate separately

🎯 Quick Reference Card

Print this and keep it handy!

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         SCOOTERCAM WEATHER & MOON SYSTEM          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Weather Status:  scootercam.net/wx-status.php    β”‚
β”‚ Combined Status: scootercam.net/wx-status-       β”‚
β”‚                  combined.php                     β”‚
β”‚                                                   β”‚
β”‚ Service:         https://cron-job.org             β”‚
β”‚ Weather Updates: Every 5 minutes                  β”‚
β”‚ Moon Updates:    Every hour                       β”‚
β”‚                                                   β”‚
β”‚ Weather Token:   [write yours here]              β”‚
β”‚ Moon Token:      [write yours here]              β”‚
β”‚                                                   β”‚
β”‚ Weather Log:     /wx/webhook.log                  β”‚
β”‚ Moon Log:        /wx/moon-webhook.log             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ TROUBLESHOOTING:                                  β”‚
β”‚ 1. Check status page                             β”‚
β”‚ 2. Check Cron-Job.org dashboard                  β”‚
β”‚ 3. Test webhook manually (with token)            β”‚
β”‚ 4. Check log files                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Version History

Version 2.0 (October 2025) – Current

  • ✨ Complete webhook-based system (no cron needed)
  • ✨ Separate weather and moon phase systems
  • ✨ Visual monitoring dashboards
  • ✨ Comprehensive documentation
  • ✨ Installation diagnostic tool
  • ✨ Enhanced error handling and logging

Version 1.0 (Previous)

  • Basic cron-based system
  • Required server access
  • Limited monitoring

πŸŽ‰ You’re All Set!

Once setup is complete, your system will:

  • βœ… Update weather data automatically every 5 minutes
  • βœ… Update moon phase data automatically every hour (if installed)
  • βœ… Send email alerts if anything fails
  • βœ… Provide visual monitoring via status dashboards
  • βœ… Work reliably with zero maintenance

Start with SETUP-CHECKLIST.md to get going in 5 minutes! πŸš€


Questions? Everything is documented – check the relevant .md file for detailed info!

Scootercam