21 April 2008 @ 10:50Recording MP3 streams with Applescript
The other day when Ralph Bakshi was scheduled to be interviewed on WNYC, it prompted me to try to find a way to record the MP3 stream while I was away.
The basis of my Applescript was the following curl command:
I have yet to figure out how to get the Applescript to look at the iCal event it is attached to in order to find when it should end the curl process. I don't even know if this is possible. As of right now, I have an Applescript that requires user interaction when launched to obtain the duration and url of the stream. Of course, in its current state it is unfit to be attached to an iCal event.
One somewhat clumsy way of doing this would be to have two separate Applescripts -- one to start the recording and one to end the recording, but adding and maintain these events would sure be a pain.
If anyone out there knows how to have the script that is attached to an event access the end time and description of the event, I would love to know. It would go something like this: have a script that is attached to an iCal alarm, and have this script get the uid of the event that opened the script. Then have the script look at the end time of the event and calculate the duration of the recording, and get the url of the stream out of the description.