Push hilights and msg’s from IRSSI to your iPhone

A little unorthodox but I’m taking this one in english. I guess there’s just a tiny fraction of the worlds population that really can have any help from this – so why not try to reach out to every one of these.

Wouldn’t it be nice if all your hilights and MSG’s got pushed to your iPhone, and only if your screen is detached? I’ve put together bits of random internet code and achieved this – along with the app Prowl.

First register on Prowl’s website and generate an API-key (have this ready for the scripts later on). Then download the app to your iPhone. It costs 3$. Worth it. Allow it to push to your phone. Login with your username/password through your iPhone app; and it’s connected.

I got my IRSSI inside a screen. The screen is created with the following command.

screen -S irc

This allows me check whether my screen is attached or detached. I don’t want all the MSG’s and all the hilight to be pushed to be when I’m sitting with the computer.

Now you just need these scripts which I have hacked together. This could have been done a lot cleaner but this quick- and multi language method works.

This IRSSI-script which makes things happend when words get hilighted or if you get messages. Change at least your nick in the file path to the next script. The auther is credited inside.  Download the script to ./irssi/scripts/autorun/ and load it with

/script load autorun/push.pl

This BASH-script checks if your screen is attached or detached. If its attached; the script just exits. If not it send the message forward to the python implementation that sends the push message! Remember to make it runable with

chmod +x irssiPush

Sidenote: In the BASH-script you can add a URL which will get lauched if you want it to upon push. For this you might be interrested in this “screen+IRSSI”-web solution I’ve made: https://github.com/torvald/MISBI

The code that pushed the actual message can be cloned from github.

git clone https://github.com/babs/pyrowl

I edited the test.py so it looked like this and called it pushIPhone. Add your API-key in this one!

And then your done!  :)

I could probably putted the BASH-code within the last python-script – but I also use this push system for other things (server surveillance) – thats why I kept them apart.

 

This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to Push hilights and msg’s from IRSSI to your iPhone

  1. Jan Egil Jægersborg says:

    Nice! Will come in handy when writing my own android push app :)

  2. John Doe says:

    I get the following error:

    Traceback (most recent call last):
    File “/home/user/.irssi/pushIPhone”, line 4, in
    from pyrowl import Pyrowl
    ImportError: No module named pyrowl

    Any help is appreciated, nice guide btw.

    • Torvald Lekvam says:

      You must have the pushIPhone file inside the prowl directory. If you do not; pushIPhone will not know where to locate the pyrowl module.

      • John Doe says:

        I’ve tried this, I still get an import error.

        Is there some way to msg you via email or IM so I don’t spam your blog?

  3. John Doe says:

    Torvald Lekvam: Could be because it’s now called PyNMA? Renaming the import and a function it uses gets me further; but it says my API key is invalid length.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>