repology_history_atom.sh - randomcrap - random crap programs of varying quality
(HTM) git clone git://git.codemadness.org/randomcrap
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
repology_history_atom.sh (611B)
---
1 #!/bin/sh
2 # uses webdump to convert a table from TSV to Atom.
3 # can be used with sfeed to convert it to other formats.
4 #
5 # Dependencies: webdump-git
6
7 # https://repology.org/project/${name}/history
8 # repology_history(url)
9 repology_history() {
10 curl -s "$1" | \
11 webdump -s table -u 'tr th' | \
12 LC_ALL=C awk '
13 BEGIN {
14 FS = OFS = "\t";
15 print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
16 print "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en\">";
17 }
18 {
19 print "<entry>";
20 print "<title><![CDATA[" $2 "]]></title>";
21 print "<updated>" $1 "</updated>";
22 print "</entry>";
23 }
24 END {
25 print "</feed>";
26 }
27 '
28 }