Skip to content

Instantly share code, notes, and snippets.

@joostrijneveld
Created May 9, 2015 20:58
Show Gist options
  • Save joostrijneveld/35d4b2f6532a5187d8a8 to your computer and use it in GitHub Desktop.
Save joostrijneveld/35d4b2f6532a5187d8a8 to your computer and use it in GitHub Desktop.
Facebook autoresponder plugin for Poezio
from plugin import BasePlugin
class Plugin(BasePlugin):
def init(self):
self.api.add_event_handler('conversation_msg', self.on_msg)
self.api.add_event_handler('private_msg', self.on_msg)
def on_msg(self, msg, tab):
tab.command_say('[Automatic response] I stopped reading Facebook chat. Do try in some other way!')
@joostrijneveld
Copy link
Author

This is a plugin for the Poezio XMPP client. As of writing, it still works with Facebook chat, although Facebook has deprecated this feature and announced that it would drop support on 2015-04-30. I recommend running it in screen on a server somewhere.

  1. Get Poezio:
    1. git clone git://git.poez.io/poezio
    2. cd poezio
    3. ./update.sh
  2. Save the above file to poezio/plugins as autoresponder.py
  3. Configure it for Facebook chat by editing ~/.config/poezio/poezio.cfg
    1. jid = [email protected]
    2. password = yourpassword
    3. server = chat.facebook.com
    4. plugins_autoload = autoresponder
  4. Start Poezio: ./launch.sh

If you get pyvenv' executable not found. Check that you have python (>= 3.4) installed, and that $POEZIO_VENV_COMMAND points to a valid virtualenv command.,
then try: apt-get install python3-venv.

See https://www.facebook.com/help/usernames/general for information on Facebook usernames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment