aboutsummaryrefslogtreecommitdiff
path: root/tools/list-by-updated.sh
blob: 61b9a0ea1cf3fbdcb58499b9f0969975b072a4eb (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh -e

for tracked_dir in ~/.config/automedia/rss/tracked/* ~/.config/automedia/html/tracked/*; do
    cat "$tracked_dir/updated"
    echo " " $(basename "$tracked_dir")
done | sort -nr | while IFS= read -r line; do
    timestamp=$(date -d @$(echo "$line" | cut -d' ' -f1))
    tracked_item=$(echo "$line" | cut -d' ' -f2-)
    echo "$timestamp" "|" "$tracked_item"
done