genere.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
---
genere.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)",
20 "t",
21 ( .contents[] | .[] | select(.type == "RaiPlay Programma Item") |
22 "[1|\(.name | gsub("\\|"; "\\|"))|" +
23 "'"${PROGRAMMA_CGI}"'?\(.path_id | gsub("\\|"; "\\|"))|server|port]"
24 )
25 '