Skip to content

Instantly share code, notes, and snippets.

@csbogdan
csbogdan / engagement-watch.py
Created November 6, 2026 22:14
polari-watch: hourly read-only Reddit/Bluesky/App Store notifier (Reddit Data API request)
#!/usr/bin/env python3
"""Hourly (com.polari.engagement-watch.plist): what moved since last hour on Reddit, Bluesky, the App Store reviews feed and
Polari's own server (sign-ups, suggestions, ratings); any change goes to Bogdan as one iMessage (handle in ~/.polari-review-to,
kept out of git). Public endpoints only, no logins; Instagram has none, so it isn't here. First run only records the state.
Reddit rate-limits anonymous reads (429): that source is then skipped for the hour, the others still report."""
import json, os, re, subprocess, sys, urllib.request, xml.etree.ElementTree as ET
from datetime import datetime
STATE = os.path.expanduser("~/.polari-engagement-state")
TO = os.path.expanduser("~/.polari-review-to")
[Unit]
Description=Network fabric for containers
Documentation=https://github.com/coreos/flannel
Before=docker.service
After=network-online.target
[Service]
Type=notify
Restart=always
RestartSec=5
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
require 'net/https'
require 'json'
require 'open-uri'
module APIG
SEVERITY_TO_STATUS = {
1 => {'status' => 'critical', 'message' => 'Severity 1 issue. Look into it asap!'},
2 => {'status' => 'warning', 'message' => 'Severity 2 issue.'},
3 => {'status' => 'warning', 'message' => 'Severity 3 issue.'}
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
require 'Dashing/Jenkins'
require 'rubygems'
require 'net/https'
require 'json'
require 'open-uri'
module APIG
SEVERITY_TO_STATUS = {
1 => {'status' => 'critical', 'message' => 'Severity 1 issue. Look into it asap!'},