From The Compiler, 6 Years ago, written in Python.
Embed
  1. import weechat
  2.  
  3. weechat.register("notify-command", "The Compiler", "0.01", "GPL3",
  4.                  "Call external commands on highlights/messages/dcc", "", "")
  5.  
  6. weechat.hook_signal("weechat_hilight", "signal_callback", "")
  7. weechat.hook_signal("weechat_pv", "signal_callback", "")
  8.  
  9. def signal_callback(data, signal, signal_data):
  10.         weechat.prnt("", "Data:")
  11.         weechat.prnt("", repr(data))
  12.  
  13.         weechat.prnt("", "Signal:")
  14.         weechat.prnt("", repr(signal))
  15.  
  16.         weechat.prnt("", "signal_data:")
  17.         weechat.prnt("", repr(signal_data))
  18.  
  19.         return(weechat.WEECHAT_RC_OK)