useful-scripts/getStarred.sh

19 lines
569 B
Bash
Raw Normal View History

2024-09-13 10:22:16 +00:00
#!/bin/bash
# https://www.alexhyett.com/notes/getting-starred-items-from-miniflux/
# Define API endpoint and token
API_URL=""
AUTH_TOKEN=""
# Fetch JSON response from the API
response=$(curl -s -H "X-Auth-Token: $AUTH_TOKEN" $API_URL/v1/entries?starred=true)
# Parse JSON and format as markdown links with two new lines between results
markdown=$(echo "$response" | jq -r '.entries[] | "[\(.title)](\(.url))\n"')
# Copy the result to the clipboard with additional newline separation
printf "%s\n\n" "$markdown" | pbcopy
echo "Markdown links copied to clipboard."