Jump to content

New Aurora To Wake me up


HeXXX

Recommended Posts

Hi hak'ers.

I recently stumpled upon the OS X alarm clock entry at the Hak5 Wiki (http://wiki.hak5.org/wiki/RSS_Alarm_Clock_Under_OS_X), and decided I wanted to try it out (I am a sleepyhead)

I got it all working pretty quickly, however there one issue:

Since the guide were made, Aurora has changed a bit:

1. now there is only a 14-day trial :(

2. Aurora uses embedded iTunes instead of the real deal.

So the problem is:

The python script can't "hook" iTunes (since it's not being used for playback no more) and there is therefore no delay between (embedded) itunes start playing music, and recent slashdot articles are being read out loud by Vicki. Very annoying.

Here is the code:

#def pauseitunes():
    """If iTunes is running, pauses playing track"""
    os.system("""osascript <<EOF 
    tell application \"System Events\" to if (application processes whose name is \"iTunes\") is not {} then tell application \"iTunes\" to pause
    EOF""")

I tried replacing \"iTunes\" with Aurora, and iTunesHelper which both resulted in same error:

execution error: The variable pause is not defined. (-2753)

I'm new to system developing in OSX, so I didn't know osascript before reading this.

Is there any way to "descripe" an application so I can figure out how to pause the Aurora sound?

Thanks in advance.

Link to comment
Share on other sites

you could downgrade to the version the used in the hak5 wiki. or look for newer hacks

Thanks for the reply.

Metaquark does have a link to Aurora3 at their website, but I have already made a a small hack myself.

All I did was change the playitunes() and pauseitunes() functions in speakrss.py, to find and stop Aurora with kill. And resume (-CONT) when the news has been read out loud.

Here is the code:

def pauseitunes():
    """If iTunes is running, pauses playing track"""
    os.system("for pid in `ps axc | grep Aurora | awk 'END{print $1}'`; do kill -STOP $pid; done")

def playitunes():
    """If iTunes is running"""
    os.system("""for pid in `ps axc | grep Aurora | awk 'END{print $1}'`; do kill -CONT $pid; done""")

Remember to run

py2applet speakrss.py

... After editing the speakrss.py file

I know it's a dirty hack, so please don't hesitate to write improvements :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...