Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Listen to an hourly CNN news update podcast Apps
CNN has an hourly news update distributed as a podcast in iTunes 4.9. This news update is about two minutes long and contains no commercials. I wanted to insert this into the Party Shuffle at the top of each hour, just like real radio stations do ("You're listening to WRCT Pittsburgh; here's the news...").

I set my podcasts to update every hour. This applies to all podcasts; iTunes lacks an option to update just one podcast hourly, and there doesn't seem to be an AppleScript command to update them programmatically. I then modified this hint, which inserts a song into the Party Shuffle list, to insert the newest CNN update into the Party Shuffle if and only if iTunes is playing from that playlist. Here's the modified script. I saved this as ~/Documents/cnn-update.scpt. I then used cron to run this script at the top of every hour:
$ cat > /tmp/entries
0 * * * * osascript /Users/jweill/Documents/cnn-update.scpt
^D (control-D)
$ crontab /tmp/entries
The only downside is that I usually get an e-mail locally that contains some text like "iTunes, iTunes, iTunes, iTunes," or a status message, when the script gets run. I don't know how to suppress that output without just adding > /dev/null to the command in crontab.
    •    
  • Currently 1.00 / 5
  You rated: 1 / 5 (4 votes cast)
 
[12,714 views]  

Listen to an hourly CNN news update podcast | 11 comments | Create New Account
Click here to return to the 'Listen to an hourly CNN news update podcast' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Listen to an hourly CNN news update podcast
Authored by: rocteur on Jul 21, '05 10:40:38AM

The worse thing about this hint, apart from 1) listening to CNN and 2) using podcasts, is that you've just wiped out any crontab entries you may have had!

It would be safer for you to run: crontab -e even if you don't have crontabs setup.

And if you're using tiger, it would be smarter and prepare for the future by using LaunchDaemons



[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: jweill on Jul 21, '05 11:38:32AM

I am using Tiger but crontab works just as well as it has for decades. I agree about overwriting your existing crontab; of course you should edit it in place if any entries already exist.

I'm sure that if you modify the hint, you can make it play anything you like. CNN is the only news outlet I've found that has real human beings reading up-to-date news in two-minute blocks.



[ Reply to This | # ]
Safer Crontab Editing
Authored by: colter on Jul 21, '05 11:58:26AM
I've been using Cronnix for a while now to manage my crontabs. It's easier than remembering the entry format by hand, that's for sure.

[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: Demani on Jul 21, '05 10:46:11AM

ah...WRCT- those were the days.

I thought LaunchD had an issue with running timed events reliably, i.e. sometimes the first event would run but not subsequent events. Is all that reolved with 10.4.2?



[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: rpaul on Jul 21, '05 12:41:04PM
The only downside is that I usually get an e-mail locally that contains some text like "iTunes, iTunes, iTunes, iTunes," or a status message, when the script gets run. I don't know how to suppress that output without just adding > /dev/null to the command in crontab.
Just add the following to the head of your crontab file:
        SHELL=/bin/sh
        MAILTO=""
Checkout the manual from the command line for other environment variables:
        % man 5 crontab




[ Reply to This | # ]
Thank you
Authored by: lullabud on Jul 21, '05 01:15:31PM

Man, I KNEW that when I switched to Mac I'd learn all sorts of cool Unix tricks that would help me on my linux boxes, and it's been exactly that. :) There's just not enough time to find all these little things out on your own, you know?



[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: thoughton on Jul 21, '05 04:46:38PM

Thanks for the fantastic hint :)



[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: Ranger Rick on Jul 22, '05 05:05:29PM

this script wants to start my iTunes whether it's running or not... the "tell application iTunes" bit in ps_play_next_ref opens itunes if it's not already running (if I comment that part out it doesn't)

I tried digging into it but I'm an applescript newbie, even wrapping that function with the "name of processes" bit doesn't stop it.

Any ideas why?



[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: Ranger Rick on Jul 22, '05 05:29:52PM

I stand corrected, even the first tell application "iTunes" part opens itunes when it wasn't already running. :P



[ Reply to This | # ]
Listen to an hourly CNN news update podcast
Authored by: rmiller021 on Aug 01, '05 05:08:47PM

tell application "System Events"
	if application process "iTunes" exists then
		tell application "iTunes"
			--code for itunes
		end tell
	end if
end tell

---
I have no clue what i am doing

[ Reply to This | # ]

Listen to an hourly CNN news update podcast
Authored by: SeƱor Epiphyte on Jul 24, '05 01:01:39PM

Thank you, indeed it is readily transferable to other Podcasts. I have slightly modified the script to push New Music Tuesdays into the Party Shuffle periodically on Tuesdays.

Cronnix is a great crutch in my first dabbling in cron.



[ Reply to This | # ]