D
D
Dmitry Belyaev2018-06-08 22:43:20
Ruby on Rails
Dmitry Belyaev, 2018-06-08 22:43:20

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

2 answer(s)
B
blackst0ne, 2018-06-09
@blackst0ne

If this is a separate script, and not part of the application, then you can send kill -15 PIDthe script via cron.

R
Roman Mirilaczvili, 2018-06-09
@2ord

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 question

Ask a Question

731 491 924 answers to any question