elenco-programmi.dcgi - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
elenco-programmi.dcgi
---
1 #!/bin/sh
2
3 . ../common/config.sh
4
5 PROGRAMMA_CGI="${CGI_BASEDIR}/raiplay/programma.dcgi"
6
7 url="https://www.raiplay.it/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json"
8
9 curl -gs "${url}" |
10 jq -r '.[] | .[] | (
11 .name + "\t" +
12 .tipology + "\t" +
13 .PLRanno + "\t" +
14 .PathID
15 )' | sort | awk '
16 BEGIN {
17 FS = "\t"
18 }
19
20 {
21 title = $1
22 tipology = $2
23 year = $3
24 pathid = $4
25
26 desc = title
27 if (year) {
28 desc = desc " (" year ")"
29 }
30 if (tipology) {
31 desc = desc " - " tipology
32 }
33
34 gsub("\\|", "\\|", desc)
35 gsub("\\|", "\\|", pathid)
36
37 printf("[1|%s|'"${PROGRAMMA_CGI}"'?%s|server|port]\n", desc, pathid)
38 }
39 '