Answer the question
In order to leave comments, you need to log in
Scheduled online radio grabbing in Ruby or Node.JS?
There is a task - to record a radio program twice a week (from the broadcast address www.5-tv.ru/radio.mp3) at certain time intervals.
For example, the program goes on the air on Sunday from 18:00 to 19:00 and on Tuesdays from 00:00 to 01:00
. Just how to record a stream, I imagine. The matter is simple.
But here's how to make the recording start (this is understandable, according to the cron) and end (this is not clear) at specified times?
Answer the question
In order to leave comments, you need to log in
If this is a separate script, and not part of the application, then you can send kill -15 PID
the script via cron.
There is gem clockwork, especially for periodic tasks.
For example:
every(1.day, 'mondays.send_news', :at => '01:00', :if => lambda { |t| t.wday == 1 }
) recording time interval. Stop recording when you're done.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question