Skip to content

Instantly share code, notes, and snippets.

@HoughIO
Created March 11, 2026 17:19
Show Gist options
  • Select an option

  • Save HoughIO/d4ef2e4055d2cadf15e7eddf30d86eb3 to your computer and use it in GitHub Desktop.

Select an option

Save HoughIO/d4ef2e4055d2cadf15e7eddf30d86eb3 to your computer and use it in GitHub Desktop.
KittyCam Daily Report UI
#!/bin/bash
# Add view tracking to the main page
# Run AFTER upgrade-daily-report.sh
echo "📊 Adding view tracking to frontend..."
# Add view logging to the index.html init function
sudo sed -i 's|async function init(){|async function init(){\n // Log view\n fetch("/api/log-view", {method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:"live"})}).catch(()=>{});|' /opt/kittycam/web/index.html
echo "✅ View tracking added!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment