KISS

Keep It Simple Stupid

WWDC announcement monitoring command

| comments

So, you’ve read the post’s title. Yes, it’s a bit late to publish it now, but anyway it may be helpful next year. For those who don’t get it, WWDC is a prestigious Apple’s conference for developers.

This script turned out not to be particularly useful this year, as Apple decided to make a lottery for deciding who can have a right to buy a ticket ($1600). Previous years, you could get a ticket during some time after announcement. In 2013, the tickets sold out in about 70 seconds! That’s why you could use a script to monitor the announcement to be able to grab a ticket faster.

Here’s what I came up with this year:

1
*/15 * * * * ( /sbin/ping -t4 4.8 >/dev/null || { echo "No internet"; exit 0; } && { /usr/bin/curl -s https://developer.apple.com/wwdc/ | /usr/bin/grep -q 'WWDC 2013'; } ) || /usr/local/bin/terminal-notifier -title '🍎' -message 'Check the WWDC page\!' -sound default -open 'https://developer.apple.com/wwdc/'

It’s actually a crontab line that runs the script every 15 minutes (*/15). To install, you could save it to a file like ~/.crontab, then run crontab ~/.crontab. The idea behind the command is that it checks whether the WWDC page still has the previous year’s text (here, WWDC 2013). If not, display an alert (with terminal-notifier).

That’s all.

ps. You can check the script isn’t failing by running mail in the terminal. If there is no output from the script, you’ll get no mail.

Comments