Will short of actually writing scripts, let me see if I can point you in the right direction. Seems like this project would require two scripts. The first you already have run a cron job periodically find out what current temperature is, now store this figure in a file, by adding a simple > temperature file name. Next write a script that reads this number from the file and assigns it to a variable, temp=$(< temperature file name). Now include a series of if statements as in If $temp = 70 then cartnumber = 3400 If $temp = 71 then cartnumber = 3401 Etc etc At the end of this loop simply run rmlsend MN\ 1\ $cartnumber\!
Say we name this script gettemp.sh We then create a macro cart with the command RN sh get temp.she in it. Usage might be something like this in your log. Your macro cart Cart xxxx recorded weather forecast The cart loaded by your macro and script (DJ saying and currently the temperature is) The next item in your log. The idea being that the script would run on command from your macro cart during the local weather forecast above and load in the correct temperature cart to follow. You might need depending on timing need to add a 1 second Sleep command at the top of your macro cart to make sure the make next in your script doesn't load too quickly. Hope this makes sense. When I have some free time I would be happy to put this together but I'm in the middle of moving a transmitter site. Cheers On 13 Apr 2013 07:33, "Peter Claes" <[email protected]> wrote: > Tim, > > Do you have an example on how to do this ? > > I mean getting an external scriptresult into a macro. > > Regards > Peter > > Verstuurd vanaf mijn iPhone > > Op 12-apr.-2013 om 15:16 heeft Tim Camp <[email protected]> het volgende > geschreven: > > Greetings, > Just a thought that a better way to do this instead of messing with audio > files in var and, have you script assign temperature to a variable then > have a macro cart in your log that would read the variable and run rmlsend > MN to load the correct cart, this is just one of several ways I can think > of to accomplish this without recording over var and audio or even using > rdimport, if the files are there, just pick and play the correct one. Just > some food for thought gentlemen. > > Cheers > On 12 Apr 2013 08:05, "Robert Orr" <[email protected]> wrote: > >> so do we... it should work as is. >> Thanks for trying it and giving feedback >> Robert >> >> >> On Fri, Apr 12, 2013 at 2:58 AM, Peter Claes <[email protected]>wrote: >> >>> Robert, >>> >>> Tried it, works like a charm ! >>> Had to alter at bit, Because we works in centigrades :) negative values >>> >>> Many thanks ! >>> Peter >>> >>> Verstuurd vanaf mijn iPhone >>> >>> Op 10-apr.-2013 om 17:09 heeft Robert Orr <[email protected]> het >>> volgende geschreven: >>> >>> Hi Jamie, >>> I have 80 carts numbered from 3460 to 3540 that contain the temperatures >>> from minus 40 to plus 40. In actuality, each of those carts has a dj >>> reading "it's minus 40 in Saskatoon" or "it's minus 39 in Saskatoon" ... >>> etc. >>> All the audio for carts in Rivendell are stored in /var/snd ie. the >>> audio for cart number 3460 is /var/snd/003460_001.wav so here's what my >>> script does: >>> cd /var/snd #change directory to /var/snd >>> rm -f canada_e.html >>> wget -q http://text.weatheroffice.gc.ca/canada_e.html #grab the >>> text version of the temperature website >>> j=`cat canada_e.html |grep Saskatoon |sed -e :a -e >>> 's/<[^>]*>//g;/</N;//ba; s/[a-zA-Z&;]//g'` #strip out everything >>> except the temperature in Saskatoon for example 15 >>> s=$((3500+$j)) #in our 15 degree example s would equal >>> 3515 >>> file=00${s}_001.wav #the audio file that corresponds to 15 >>> degrees is 003515_001.wav >>> cp $file 004000_001.wav #replace the 004000_001.wav audio with, in >>> our example, the 003515_001.wav audio so when cart 4000 is played it will >>> say "it's 15 degrees in Saskatoon". >>> >>> The script is called commandtoextracttemperature.sh and is stored in my >>> home directory and made executable. This line in the root crontab >>> 4,24,44 * * * * /home/robert/commandtoextracttemperature.sh >>> fires the script every 20 minutes and I insert cart 4000 any time in the >>> log that I want the current temperature recording to play. >>> Note, messing with the audio in /var/snd is not the approved method of >>> doing things in Rivendell. I should be doing an rdimport command. But it >>> works for me and I wrote that script many years ago before I knew you could >>> import without the gui. >>> >>> Hope that helps. >>> Robert >>> >>> >>> On Wed, Apr 10, 2013 at 6:14 AM, Jamie Dominey <[email protected]>wrote: >>> >>>> Can you give more details? I'm not that familiar with scripts. Where >>>> are the 80 carts located and how are they named and numbered? >>>> >>>> Thanks >>>> >>>> >>>> On Tue, 2013-04-09 at 10:14 -0600, Robert Orr wrote: >>>> > Here's mine. I have 80 carts prerecorded with "It's 15 degrees in >>>> > Saskatoon", "It's 16 degrees in Saskatoon" etc. The script below just >>>> > runs every 20 minutes via crontab and I have cart 4000 inserted in my >>>> > log whenever I want to give the temperature: >>>> > cd /var/snd >>>> > rm -f canada_e.html >>>> > wget -q http://text.weatheroffice.gc.ca/canada_e.html >>>> > j=`cat canada_e.html |grep Saskatoon |sed -e :a -e >>>> > 's/<[^>]*>//g;/</N;//ba; s/[a-zA-Z&;]//g'` >>>> > s=$((3500+$j)) >>>> > file=00${s}_001.wav >>>> > cp $file 004000_001.wav >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > On Tue, Apr 9, 2013 at 9:54 AM, Bill Putney <[email protected]> wrote: >>>> > There is weather station software that runs on Linux >>>> > (Weather-Display >>>> > for one) and hobby class weather stations are not that >>>> > expensive. If >>>> > have all your own temperature, humidity, wind speed/direction >>>> > and rain >>>> > gauge from your own station it is likely to be better and more >>>> > current >>>> > than the online sources, unless you live next to a major >>>> > airport. All >>>> > the information would be available as local variables >>>> > refreshed minute >>>> > by minute to make decisions about what to play. >>>> > >>>> > Bill >>>> > >>>> > On 4/9/13 8:17 AM, Sébastien Leblanc wrote: >>>> > > Damn, just checked their terms of use (Forecast.io) and >>>> > they don't >>>> > > allow radios, newspapers, broadcast and cable television to >>>> > use their >>>> > > API... >>>> > > _______________________________________________ >>>> > > Rivendell-dev mailing list >>>> > > [email protected] >>>> > > >>>> > >>>> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >>>> > >>>> > _______________________________________________ >>>> > Rivendell-dev mailing list >>>> > [email protected] >>>> > >>>> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >>>> > >>>> > >>>> > >>>> > _______________________________________________ >>>> > Rivendell-dev mailing list >>>> > [email protected] >>>> > http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >>>> >>>> >>>> _______________________________________________ >>>> Rivendell-dev mailing list >>>> [email protected] >>>> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >>>> >>> >>> _______________________________________________ >>> Rivendell-dev mailing list >>> [email protected] >>> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >>> >>> >>> _______________________________________________ >>> Rivendell-dev mailing list >>> [email protected] >>> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >>> >>> >> >> _______________________________________________ >> Rivendell-dev mailing list >> [email protected] >> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev >> >> _______________________________________________ > Rivendell-dev mailing list > [email protected] > http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev > > > _______________________________________________ > Rivendell-dev mailing list > [email protected] > http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev > >
_______________________________________________ Rivendell-dev mailing list [email protected] http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
