#!/bin/bash # Fetch the JSON data and parse it with jq to create markdown links response=$(curl -s "https://feeds.stevedylan.dev?format=json" | \ jq -r '.subscriptions[] | "- [\(.title)](\(.htmlUrl))"' | \ sort) # Copy to clipboard (works on macOS, Linux with xclip, or Linux with xsel) if command -v pbcopy &> /dev/null; then # macOS echo "$response" | pbcopy echo "✔︎ Feeds copied to clipboard" elif command -v xclip &> /dev/null; then # Linux with xclip echo "$response" | xclip -selection clipboard echo "Copied to clipboard (xclip)" elif command -v xsel &> /dev/null; then # Linux with xsel echo "$response" | xsel --clipboard --input echo "Copied to clipboard (xsel)" else echo "Error: No clipboard utility found. Install pbcopy (macOS), xclip, or xsel (Linux)" echo "$response" exit 1 fi