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.