18 lines
569 B
Bash
Executable file
18 lines
569 B
Bash
Executable file
#!/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."
|