IrssiNotifier icon indicating copy to clipboard operation
IrssiNotifier copied to clipboard

add a Python Interface for IrssiNotifier

Open evgeni opened this issue 11 years ago • 6 comments

While irssi itself loves Perl, Python is quite a nice language too. People even might want to send notifications from Python because

  • they use weechat instead of irssi (traitors)
  • they use X-Chat instead of irssi (even bigger traitors)
  • want to abuse the nice interface IrssiNotifier offers for other notifications coming from their machines (regular hackers)
  • they execute Python via exec in irssi because they can

For all these people, let there be a Python interface:

>>> notifier = IrssiNotifier(API_KEY, PASSWORD)
>>> notifier.send_message("message", "#channel", "nick")

evgeni avatar Apr 01 '13 15:04 evgeni

Thanks, I guess!

Not sure where this should go. I wish Irssi itself supported Python for scripting (since I suck at Perl), but for the time being, I'm not sure what I should do with this script :P.

I'll let this pull request hang around until I decide something. Still, thanks!

murgo avatar Apr 01 '13 18:04 murgo

Heh. Yeah, python for irssi would be cool. I often suck at Perl too.

I wrote the script to notify myself about different kind-of-IM events on my server at home w/o writing an IRC bot just to get it pushed to my mobile.

If you want, I could drop a weechat proof of concept script (would need to read weechat scripting first).

evgeni avatar Apr 01 '13 19:04 evgeni

It seems that there is need for official weechat script, since there's at least three weechat -scripts already floating around.

http://www.weechat.org/files/scripts/irssinotifier.py (rude script since it's on the official site but doesn't even mention my name :P) https://github.com/webvictim/irssinotifier https://github.com/leitmedium/weechat-irssinotifier

murgo avatar Apr 01 '13 19:04 murgo

bah, they all call openssl directly (I know, your irssi script does too :))

let me hack a bit

evgeni avatar Apr 01 '13 19:04 evgeni

I've received multiple pull requests with openssl changed to Perl's Crypt or whatever, but since that's not core module, I don't want to use it.

One of the goals for my IRC script has been the ease of installation, and many people use IRC from some random boxes they cannot install anything on, so it's best to keep the requirements minimum.

Of course, it's no way mandatory for derivative works.

murgo avatar Apr 01 '13 19:04 murgo

There is a working PoC. :)

And for random boxen: while I would not trust them, cpan works also w/o root access ;)

evgeni avatar Apr 02 '13 13:04 evgeni