categoria.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
---
categoria.dcgi
---
1 #!/bin/sh
2
3 . ../common/config.sh
4
5 GENERE_CGI="${CGI_BASEDIR}/raiplay/genere.dcgi"
6
7 case "$2" in
8 film | fiction | serietv | bambini | programmi | documentari | performing-arts )
9 url="https://www.raiplay.it/$2/index.json"
10 ;;
11 *)
12 exit 1
13 ;;
14 esac
15
16 curl -Lgs "${url}" |
17 jq -r '
18 "t",
19 "t\(.name)",
20 "t",
21 ( .contents[] | .contents[] | select(.sub_type == "RaiPlay V2 Genere Page") |
22 "[1|\(.name | gsub("\\|"; "\\|"))|" +
23 "'"${GENERE_CGI}"'?\(.path_id | gsub("\\|"; "\\|"))|server|port]"
24 )
25 '