blob: cf694b388064a118715c0e6bd56a3ea847dd8b2b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/sh
# adapted from https://git.segvallday.org/ass2atom/file/ass2atom.html
# 0BSD License - Full text at the bottom of this file
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
echo "<feed xmlns=\"http://www.w3.org/2005/Atom\">"
echo "<title type=\"text\">dzwdz</title>"
echo "<updated>$(date -Iseconds)</updated>"
echo "<id>urn:uuid:677e5055-07e1-43d6-bd58-fda18d3c5277</id>"
to_atom_entry() {
while read line; do
entry_date=$(echo "$line" | cut -f1)
entry_url=$(echo "$line" | cut -f2)
entry_title=$(echo "$line" | cut -f3)
echo "<entry>"
echo "<title>$entry_title</title>"
echo "<link href=\"$entry_url\"/>"
echo "<updated>${entry_date}T00:00Z</updated>"
echo "<id>${entry_url}?${entry_date}</id>"
echo "</entry>"
done
}
grep -e "^[^#]" | sort -r | to_atom_entry
echo '</feed>'
# BSD Zero Clause License
#
# Copyright (c) 2023 segvallday, adapted by dzwdz
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
|