• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

meteo automatico

Started by maury81bs, October 24, 2020, 02:40:08 PM

stevewa

have you tried anything else to learn how to use this?

Music Box

Hi stevewa, no I haven't done anything. As I told you I don't understand anything you've suggested, I wouldn't know where to start that's why I was asking if there is a tutorial on how to use a script with RadioDJ.
Thanks again for your interest.

Enrico58

Quote from: stevewa on January 13, 2021, 06:37:01 PM
this will download a weather audio file for the current day if it is older than 1 hour
that ensures you have the most recent weather developments

copy this code & save to a file, in a location where you have permission to execute vbscripts, i.e. maybe c:\RadioDJv2
example file name = meteo.it.weather.mp3.download.rename.vbs

then edit the config settings at the top,
url prefix to grab
path to folder of where to save the file
name of file to save as your preset
name of your radio station and email address, in case they see you abusing their logs, they can contact you

test the script
if it works, then create  Windows Task in TaskScheduler, to run this task every our, maybe 10 minutes before you intend to broadcast it inside RadioDJ.


' configuration
' urls to grab
' example https://media.ilmeteo.it/audio/2021-01-13.mp3
Dim UrlGrabPrefix : UrlGrabPrefix = "https://media.ilmeteo.it/audio/"
' set this to your radio station name and email address
Dim UrlGrabUserAgent : UrlGrabUserAgent = "MyRadio.com (tech@myradio.com)"
' set this to the folder where you want the file to be saved
Dim FileSavePath : FileSavePath = "C:\"
' set this to the preset name of the file that you want
Dim FileSaveFilename : FileSaveFilename = "weather.mp3"


' grabs content of file on website meteo.it
' save with preset filename


' get current date portions
Dim NowYear :  NowYear = Year(Now() )
Dim NowMonth :  NowMonth = Right("0" & Month(Now() ), 2)
Dim NowDay:  NowDay = Right("0" & Day(Now() ), 2)
Dim NowYearMonthDay : NowYearMonthDay = NowYear &"-"& NowMonth &"-"& NowDay
'WScript.echo "now date=" & NowYearMonthDay

' set value of file to grab based on current date
Dim UrlGrab1 : UrlGrab1 = UrlGrabPrefix & NowYearMonthDay & ".mp3"

Dim error_msgs : error_msgs = ""

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' get first file UrlGrab1

' @TODO - check if file already exists on disk, so we don't waste effort
Dim File_is_old : File_is_old = 1
Dim fso_chk : Set fso_chk = CreateObject("Scripting.FileSystemObject")
Dim FileLocalPathFilename : FileLocalPathFilename = FileSavePath & "" & FileSaveFilename

if fso_chk.FileExists( FileLocalPathFilename ) then
Dim FileLocalPathFilename_chk : Set FileLocalPathFilename_chk = fso_chk.GetFile(FileLocalPathFilename)
' check if date is today's date
'wscript.echo FileLocalPathFilename_chk.DateLastModified & " today=" & Now()
' check if file is older than 1 hour
if Hour(FileLocalPathFilename_chk.DateLastModified) = Hour(Now()) then
'wscript.echo "file is from current hour"
File_is_old = 0
else
'wscript.echo "file is older than 1 hour, go get fresh file"
File_is_old = 1
end if
else  ' file does not exist
File_is_old = 1
end if


' if file is old, then go get new file
if File_is_old then

' Object to open connection to URL
dim xHttp1: Set xHttp1 = createobject("MSXML2.XMLHTTP.6.0")

if err.number <> 0 then
wscript.echo "Microsoft.XMLHTTP not installed. Operation aborted."
error_msgs = error_msgs & "Microsoft.XMLHTTP not installed. Operation aborted."
wscript.quit(1)
end if

' Object to stream data during download
dim bStrm1: Set bStrm1 = createobject("Adodb.Stream")

if err.number <> 0 then
wscript.echo "ADOdb.Stream not installed. Operation aborted."
error_msgs = error_msgs & "ADOdb.Stream not installed. Operation aborted."
outputFile.WriteLine
wscript.quit(1)
end if

xHttp1.Open "GET", UrlGrab1, False  '//set values
' set custom user agent so this server owner can identify you in their log files
xHttp1.setRequestHeader "UserAgent", UrlGrabUserAgent

xHttp1.Send '//send command
with bStrm1 '//using data stream
.type = 1 '//binary
.open
.write xHttp1.responseBody
.savetofile FileLocalPathFilename , 2 '//overwrite
.Close '//close data stream
end with

if err.number <> 0 then
wscript.echo "Error in download and write to file. Operation aborted."
error_msgs = error_msgs & "Error in download and write to file. Operation aborted. err num=" & err.number
' short write to file msgConf
Dim fso_err : Set fso_err = CreateObject("Scripting.FileSystemObject")
Set outputFile_err = fso_err.OpenTextFile( FileLocalPathFilename & ".errlog.txt", 2, True )
outputFile_err.WriteLine error_msgs
outputFile_err.Close

wscript.quit(1)
end if

end if ' file is old = 1

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''



Buongiorno a tutti,
Stò utilizzando questo software da alcuni mesi e ne sono estremamente soddisfatto e mi ha permesso di ricominciare insieme agli amici di tanti anni fa di tornare a fare radio...
Ringrazio di cuore gli sviluppatori per l'impegno e per tutto il lavoro fatto!
leggendo i vari post ho avuto risposte per molti dei dubbi che avevo e ringrazio soprattutto Stevew che è sempre puntuale nelle risposte e consigli.
Lo script sopra funzione perfettamente e stò cercando di "convincere" W10 ad eseguirlo in modo automatico così da avere un automatismo perfetto.

Ciao a tutti e buon lavoro

Goodmorning everyone,
I have been using this software for a few months and I am very satisfied with it and it has allowed me to start over with friends of many years ago to go back to radio ...
I sincerely thank the developers for their commitment and for all the work they have done!
reading the various posts I had answers for many of the doubts I had and I especially thank Stevew
The above script works perfectly and I am trying to "convince" W10 and run it automatically so as to have a perfect automatism.

Hello everyone and good luck

Sorry for the translator's English ..... :(

Enrico E.

Music Box

Ciao Enrico58, se hai un po' di tempo da dedicarmi; puoi spiegarmi come hai fatto?
Io non ho capito una mazza di come fare..... :D :D :D
Grazie

cocodrile90

ciao @Enrico58 un informazione dove si deve copiare questo codice ??

d3dfantasy99

Ciao a tutti

Nel caso servisse ancora allego un piccolo script per il meteo

Il codice è da incollare su un blocco note e da salvare come file .bat

Dopo si può schedulare in RD come un evento "lancia applicazione"

:D


@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"

set "datemeteo=https://media.ilmeteo.it/audio/%YYYY%-%MM%-%DD%.mp3"

curl -L -o "C:\RadioDjv2\Weather\meteo.mp3" "%datemeteo%"

Mistral

Quote from: d3dfantasy99 on June 20, 2021, 02:35:17 AM
Ciao a tutti

Nel caso servisse ancora allego un piccolo script per il meteo

Il codice è da incollare su un blocco note e da salvare come file .bat

Dopo si può schedulare in RD come un evento "lancia applicazione"

:D


@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"

set "datemeteo=https://media.ilmeteo.it/audio/%YYYY%-%MM%-%DD%.mp3"

curl -L -o "C:\RadioDjv2\Weather\meteo.mp3" "%datemeteo%"


Lo proverò. Grazie però una domanda : perchè lo rinomini? basta che sia con lo stesso nome e nel database indichi di prendere il file per data.
Antonio WWR - The World Web Radio

http://www.theworldwebradio.net

Enrico58

Quote from: Music Box on March 12, 2021, 07:09:37 PM
Ciao Enrico58, se hai un po' di tempo da dedicarmi; puoi spiegarmi come hai fatto?
Io non ho capito una mazza di come fare..... :D :D :D
Grazie

Non so se hai risolto o meno.
Purtroppo mi aspettavo degli avvisi in caso di reply al mio messaggio ma non ne ho ricevuti, probabilemte per un mio errore nella configurazione.

Se serve aiuto rispondi a questo post, cercherò d tenere d'occhio il forum con regolarità.

Scusami ancora.
Enrico

Music Box

No, non ho risolto nulla, non capisco come si fa' ad importare
il file bat negli eventi.

Music Box

Finalmente ho risolto,  :bash: :bash: :bash:
Il problema sta sempre tra la sedia e la tastiera.  :D :D :bash: :bash: :bash:
Ora faccio una richiesta:
In questo script si puo' aggiungere di normalizzare il file a 0 db?
Cosi' scaricati sono veramente penosamente bassi come db.
Grazie

Iridos

Quote from: Music Box on July 06, 2021, 01:23:42 PM
Finalmente ho risolto,  :bash: :bash: :bash:
Il problema sta sempre tra la sedia e la tastiera.  :D :D :bash: :bash: :bash:
Ora faccio una richiesta:
In questo script si puo' aggiungere di normalizzare il file a 0 db?
Cosi' scaricati sono veramente penosamente bassi come db.
Grazie

Ciao hai risolto per il volume basso?

Music Box

Ciao, dopo averlo scaricato manualmente  >:D >:D   lo amplifico a o db con Audacity.
Poi gli do' una dinamica con jb broadcast.
''Il plugin jb broadcast lì ho copiato all' interno dei plugins di Audacity''
Cosi' processato suona molto meglio.  ;) ;) ;)

Iridos

Grazie Music Box, ma pensavo a un qualcosa di automatico con radiodj, un plugin che potesse normalizzare il file a 0 db.

Music Box

Ciao, purtroppo questo software non ha questa funzione.  :( :(

stevewa

#29
Try calling ffmpeg from cmd line in your batch script

150% of current volume:

ffmpeg -i input.wav -filter:a "volume=1.5" output.wav


You can also use decibel measures. To increase the volume by 10dB:

ffmpeg -i input.wav -filter:a "volume=10dB" output.wav