Add files via upload
This commit is contained in:
parent
2527829cf3
commit
5bffd7ed04
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
#
|
||||||
|
####################################################################################
|
||||||
|
# script che recupera i podcast del radio giornale dell' EmiliaRomagna
|
||||||
|
#
|
||||||
|
# v:1.0
|
||||||
|
#
|
||||||
|
# dipendenze: curl,jq,cat,wget
|
||||||
|
#
|
||||||
|
#
|
||||||
|
####################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# set global variable
|
||||||
|
|
||||||
|
grrAPI="https://www.rainews.it/dl/rai24/tgr/basic/archivio/ContentSet-11d4826f-0ca2-48b4-8c03-9679927f8732.json"
|
||||||
|
|
||||||
|
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
|
||||||
|
|
||||||
|
# remove old jason data
|
||||||
|
rm ./data/EmiliaRomagna.json
|
||||||
|
|
||||||
|
# get jason data
|
||||||
|
curl -A "$ag" "$grrAPI" -o data/EmiliaRomagna.json
|
||||||
|
echo " "
|
||||||
|
echo "get data api... done!"
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# extract jason data of the 2 last podcast stored
|
||||||
|
data0=`cat ./data/EmiliaRomagna.json | jq -r '.items[0]|.date'`
|
||||||
|
Media0=`cat ./data/EmiliaRomagna.json | jq -r '.items[0]|.mediaUrl'`
|
||||||
|
ora0=`cat ./data/EmiliaRomagna.json | jq -r '.items[0]|.title'`
|
||||||
|
|
||||||
|
data1=`cat ./data/EmiliaRomagna.json | jq -r '.items[1]|.date'`
|
||||||
|
Media1=`cat ./data/EmiliaRomagna.json | jq -r '.items[1]|.mediaUrl'`
|
||||||
|
ora1=`cat ./data/EmiliaRomagna.json | jq -r '.items[1]|.title'`
|
||||||
|
|
||||||
|
# extract time onair podcast "h_m"
|
||||||
|
Ora0=`echo $ora0 | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
|
||||||
|
|
||||||
|
Ora1=`echo $ora1 | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
|
||||||
|
|
||||||
|
# extract date onair podcast "type 10-10-2020"
|
||||||
|
Data0=`echo $data0 | sed -e 's/\//\-/g'`
|
||||||
|
Data1=`echo $data1 | sed -e 's/\//\-/g'`
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "extract data... done!"
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# download podcast
|
||||||
|
|
||||||
|
wget -d -c -U "$ag" "$Media0" -O GRR_EmiliaRomagna_"$Data0"_"$Ora0".mp3
|
||||||
|
wget -d -c -U "$ag" "$Media1" -O GRR_EmiliaRomagna_"$Data1"_"$Ora1".mp3
|
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
#
|
||||||
|
####################################################################################
|
||||||
|
# script che recupera i podcast del radio giornale del FriuliVG
|
||||||
|
#
|
||||||
|
# v:1.0
|
||||||
|
#
|
||||||
|
# dipendenze: curl,jq,cat,wget
|
||||||
|
#
|
||||||
|
#
|
||||||
|
####################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# set global variable
|
||||||
|
|
||||||
|
grrAPI="https://www.rainews.it/dl/rai24/tgr/basic/archivio/ContentSet-2420650e-49df-46a7-866c-ec6e9f53d065.json"
|
||||||
|
|
||||||
|
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
|
||||||
|
|
||||||
|
# remove old jason data
|
||||||
|
rm ./data/FriuliVG.json
|
||||||
|
|
||||||
|
# get jason data
|
||||||
|
curl -A "$ag" "$grrAPI" -o data/FriuliVG.json
|
||||||
|
echo " "
|
||||||
|
echo "get data api... done!"
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# extract jason data of the 2 last podcast stored
|
||||||
|
data0=`cat ./data/FriuliVG.json | jq -r '.items[0]|.date'`
|
||||||
|
Media0=`cat ./data/FriuliVG.json | jq -r '.items[0]|.mediaUrl'`
|
||||||
|
ora0=`cat ./data/FriuliVG.json | jq -r '.items[0]|.title'`
|
||||||
|
|
||||||
|
data1=`cat ./data/FriuliVG.json | jq -r '.items[1]|.date'`
|
||||||
|
Media1=`cat ./data/FriuliVG.json | jq -r '.items[1]|.mediaUrl'`
|
||||||
|
ora1=`cat ./data/FriuliVG.json | jq -r '.items[1]|.title'`
|
||||||
|
|
||||||
|
# extract time onair podcast "h_m"
|
||||||
|
Ora0=`echo $ora0 | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
|
||||||
|
|
||||||
|
Ora1=`echo $ora1 | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
|
||||||
|
|
||||||
|
# extract date onair podcast "type 10-10-2020"
|
||||||
|
Data0=`echo $data0 | sed -e 's/\//\-/g'`
|
||||||
|
Data1=`echo $data1 | sed -e 's/\//\-/g'`
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "extract data... done!"
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# download podcast
|
||||||
|
|
||||||
|
wget -d -c -U "$ag" "$Media0" -O GRR_FriuliVG_"$Data0"_"$Ora0".mp3
|
||||||
|
wget -d -c -U "$ag" "$Media1" -O GRR_FriuliVG_"$Data1"_"$Ora1".mp3
|
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
#
|
||||||
|
####################################################################################
|
||||||
|
# script che recupera i podcast del radio giornale della Liguria
|
||||||
|
#
|
||||||
|
# v:1.0
|
||||||
|
#
|
||||||
|
# dipendenze: curl,jq,cat,wget
|
||||||
|
#
|
||||||
|
#
|
||||||
|
####################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# set global variable
|
||||||
|
|
||||||
|
grrAPI="https://www.rainews.it/dl/rai24/tgr/basic/archivio/ContentSet-25a4aa36-bab8-425b-bb30-0852a4af2d90.json"
|
||||||
|
|
||||||
|
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
|
||||||
|
|
||||||
|
# remove old jason data
|
||||||
|
rm ./data/Liguria.json
|
||||||
|
|
||||||
|
# get jason data
|
||||||
|
curl -A "$ag" "$grrAPI" -o data/Liguria.json
|
||||||
|
echo " "
|
||||||
|
echo "get data api... done!"
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# extract jason data of the 2 last podcast stored
|
||||||
|
data0=`cat ./data/Liguria.json | jq -r '.items[0]|.date'`
|
||||||
|
Media0=`cat ./data/Liguria.json | jq -r '.items[0]|.mediaUrl'`
|
||||||
|
ora0=`cat ./data/Liguria.json | jq -r '.items[0]|.title'`
|
||||||
|
|
||||||
|
data1=`cat ./data/Liguria.json | jq -r '.items[1]|.date'`
|
||||||
|
Media1=`cat ./data/Liguria.json | jq -r '.items[1]|.mediaUrl'`
|
||||||
|
ora1=`cat ./data/Liguria.json | jq -r '.items[1]|.title'`
|
||||||
|
|
||||||
|
# extract time onair podcast "h_m"
|
||||||
|
Ora0=`echo $ora0 | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
|
||||||
|
|
||||||
|
Ora1=`echo $ora1 | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
|
||||||
|
|
||||||
|
# extract date onair podcast "type 10-10-2020"
|
||||||
|
Data0=`echo $data0 | sed -e 's/\//\-/g'`
|
||||||
|
Data1=`echo $data1 | sed -e 's/\//\-/g'`
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "extract data... done!"
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# download podcast
|
||||||
|
|
||||||
|
wget -d -c -U "$ag" "$Media0" -O GRR_Liguria_"$Data0"_"$Ora0".mp3
|
||||||
|
wget -d -c -U "$ag" "$Media1" -O GRR_Liguria_"$Data1"_"$Ora1".mp3
|
Loading…
Reference in New Issue