programma.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
---
programma.dcgi
---
1 #!/bin/sh
2
3 . ../common/config.sh
4
5 PROGRAMMA_CGI="${CGI_BASEDIR}/raiplay/programma.dcgi"
6
7 case "$2" in
8 http*)
9 url="$2"
10 ;;
11 *)
12 url="https://www.raiplay.it$2"
13 ;;
14 esac
15
16 curl -Lgs "${url}" |
17 jq -r '
18 "t",
19 "t\(.name) \(.program_info.channel // "")",
20 "t",
21 ( .items[]? |
22 "[h|\((.name + " " + .episode_title) | gsub("\\|"; "\\|"))|" +
23 "URL:https://www.raiplay.it\(.weblink | gsub("\\|"; "\\|"))|server|port]"
24 ),
25 ( .blocks[]? |
26 "t\(.name)",
27 ( .sets[] |
28 "[1|\(.name | gsub("\\|"; "\\|"))|" +
29 "'"${PROGRAMMA_CGI}"'?\(.path_id | gsub("\\|"; "\\|"))|server|port]"
30 ),
31 "t"
32 )
33 '