× Warning! This forum is in archival status. New contributions may not work.
How would one go about making a top of hour script, which plays station ID, News.....
  • Hello, So I have been searching everywhere as to where to do top of the hour news in airplay automatically without user intervention. The first thing I took a look at was liquid soap, most of the forum posts where pretty unclear as to what to do with these scripts, I tried one and got this error 

    "news = playlist ("/srv/airtime/stor/imported/TOH/snrnews.mp3")
    full = fallback(track_sensitive = false, [ switch ([({0m0s},news)]), airtime])"

    So then I try to run that script...

    "root@irc:/usr/lib/airtime/pypo/bin/liquidsoap_scripts# liquidsoap TOHNews.liq 









    At line 2, char 77: the variable airtime used here has not been previously


      defined."


    Even if that script did work, it would be no use to me. My news comes from a downloadable mp3 link which is updated every hour. 

    I then tried building a playlist to fit the job, but it does not appear to support network streams.

    If anyone has any bright ideas, it would be much appreciated!


  • 12 Comments sorted by
  • Oh my oversight

    Try this

    airtime=playlist ("/srv/airtime/stor/imported/1/")
    news = playlist ("/srv/airtime/stor/imported/TOH/snrnews.mp3")
    default = fallback(track_sensitive = false, [ switch ([({0m0s},news)]), airtime])

    Remember to  comment line 153

    Good Luck

    VOISSES
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I have written a script that in the Hacks section here as Bulk mp3 RSS Downloader. http://forum.sourcefabric.org/discussion/16113/hack-added-cron-jobable-bulk-mp3-importer-from-multi-rss-feeds-into-appropriate-watched-folders

    I NOW have an updated version - which does exactly what you need.  I am doing final tweaks before release.

    It collects podcasts on a schedule - in your case maybe every 30 mins - and files them automatically and sensibly in one folder/feed,  converts it to stereo if necessary and then it also copies the latest download to myrssfeedfolder/latest.mp3. You add this folder onto the Airtime watched folder list.

    Even if your news is not on an RSS feed - it would be VERY simple to change it to do what you want. for a single file - or make a fake RSS feed to do it.

    Then I make a repeating program and add latest.mp3 as its content - so it self updates.

    I am doing this with democracynow.org 's one hour show 3 times a day.
    Post edited by John Chewter at 2014-01-31 13:25:56
    No longer using Airtime or Libretime.
  • "At line 2, char 77: the variable airtime used here has not been previously defined."

    looking at your code above,you have 3 variable so you need to define each before you can use them
    • News             - you already define that
    • airtime           - not define
    • full                 - not define
    The one reason full was not flag is that airtime run from the last code up.

    @G Bryers also suggest


    "Even if that script did work, it would be no use to me. My news comes from a downloadable mp3 link which is updated every hour."

    Yes You can.You could use a function to pull the music,something like this

    def TOH() = 
      Get the first line of my external process
      
     result =
      list.hd(
       
               get_process_lines("wget http://somenews.com/newsmp3.php")                            
             )
      Create and return a request using this result
      request.create(result)
    end

     Create the source
    newshour = request.dynamic(TOH)


    # play some music after the news
    mymusic = playlist ("/srv/airtime/stor/imported/1/mymusic") 
    airtime = mksafe(mymusic)

    #Now the Fallback
    default = fallback(track_sensitive = false, [ switch ([({0m0s},newshour)]), airtime])

    Then use the full fallback as above .

    However ,Airtime offers many way to achieve this,so way your option before scripting


    Post edited by Voisses Tech at 2014-02-01 12:02:12
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Could somebody just tell me how to do it in liquid soap in plain English, I don't have a clue what your saying Voisses Tech ._.
  • This is the Airtime Forum.

    Liquid Soap is a basically a separate product (used by Airtime) and it lives  here: http://savonet.sourceforge.net/

    This is where people will know the answers to your questions.
    No longer using Airtime or Libretime.
  • @G Byers

    There a ways you can make Airtime do advance functions or what I would term ,just exactly what you want.

    This can be through modification of the ls_script.The skills varies from limited to Advance.
    You will find my attempts within this forum

    The process I tell you about is request.dynamics.

    Basically the common way is write a static playlist like this mymusic = playlist("/somepath/tomymusic")
    but with request.dynamic you can schedule the song to be pull whenever or from wherever you want.

    In the above example I grab the news from somewhere and then played it.

    This is a function which allows you to grab any playlist you want with minimal code then pass it to liquidsoap.

    You can fine a sample here http://dev.sourcefabric.org/browse/LS-645.
    In the above example ,it shows you how to handle say a jingle.

    If you are willing to modify your ls-script,I can walk you through






    Post edited by Voisses Tech at 2014-02-05 00:52:56
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Hi @Voisses Tech, Sorry for the late reply but your assistance would be much appreciated!
    Post edited by G Byers at 2014-04-22 16:16:55
  • OK tell me how I could assist you.

    I will more than welcome to help you.

    Listen to My station on tunein  VOISSES at the TOH (anytime except 0500-0800 (Gospel Hour),where only the time is announce)  and tell me what you really want .

    Remember I only pull down news once per week and I am on Air Sunday 2300 -Monday 0500.All other times its auto dj

    Good Luck
    VOISSES
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Ok I want the news at the top of the hour at all times, but I assume that switching to master source overrides that? Also since I originally wanted that post I would like the functionality of playing ads every 20 minutes, I believe you put them into a special folder? 


    Is it possible to add the background news jingle in the background whilst the news is playing? I have so many questions lol. After the news we have a little thing that introduces the next hour. 


    The News Source which it needs to pull from is - http://video.news.sky.com/snr/news/snrnews.mp3
    Post edited by G Byers at 2014-04-22 19:36:46
  • The suggested way to put news in is to use Airtime (especially where you have a programming department)

    this is a little tedious though

    if you use a download
    then you might want to use wget,curl,php or python,to pull the news and tag it.
    Please set up time on your server ,it will reduce headaches like Here http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/setting-the-server-time/

    1. create  say 10 minutes block TOH in your calendar.Make sure it repeats (link if necessary)
    2. Create a standard playlist (try tagging your news with the same ID.)
    3. Use the method describe here http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/using-the-airtime-import-script/ to pull the news from the folder.You could also use ftp like this http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/automated-file-import/

    Now otherwise you have to do some modification ( this method is best where you want to totally automate your system)

    then use dynamic request as I did above (the method I currently use) and bring the news with a switch at the times you want.

    Write some code I will guide you.

    look at this thread  http://forum.sourcefabric.org/discussion/14580/jingles-problematic-/p1 for guidance


    Good Luck
    Voisses




    Post edited by Voisses Tech at 2014-04-23 07:43:14
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I think it would be better if this was independent of a schedule I believe you can do it in liquid soap, I just really don't know where to start there :( 
  • Well if you want to

    Here are some examples (but make sure you understand the basic 101)

    * some of the above have scripts (textfiles) that you can pull down and note the modifications I suggests.

    Then I can show you how to inject the hourly,but you must do some coding before I can help you as I thing if you are to "have it your way" then you have to put something on paper.

    I will "teach you to fish" you have to become "fisherman"

    Just type fallback in the search and you will see a lot. and remember to print the first steps of the basic 101.


    Good Luck

    Voisses


    Post edited by Voisses Tech at 2014-04-24 03:01:35
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.