$30 off During Our Annual Pro Sale. View Details »

Synchronize gitter and IRC

Synchronize gitter and IRC

gitter (https://gitter.im/) is like chat for GitHub and IRC (https://en.wikipedia.org/wiki/Internet_Relay_Chat)
is a very old and efficient way to communicate with text. The usage of IRC is very powerful and the suitable tool if you
are a person who lives in the terminal. gitter has a nice user interface, it's easier to use (just sign with your
github credentials and you are ready) and saves your chat history.

Learn in this talk how you can take synchronize message either written in IRC or gitter - it doesn't matter which
tool you use.

Matthias Günther

May 12, 2016
Tweet

More Decks by Matthias Günther

Other Decks in Technology

Transcript

  1. Synchronize
    gitter and IRC

    View Slide

  2. gitter and IRC
    gitter is like chat for GitHub
    and IRC is a very old and
    efficient way to communicate
    with text.

    View Slide

  3. Demo time
    Just let you show something ..

    View Slide

  4. Prior conditions
    Create heroku profile, and get
    gitterbot api token from https://
    developer.gitter.im/apps.

    View Slide

  5. Get the code
    Go to https://github.com/finnp/
    gitter-irc-bot and click on
    deploy to heroku.

    View Slide

  6. Saving credentials
    var opts = {
    ircServer: "irc.freenode.net",
    ircChannel: "#padrino",
    ircNick: "padrinobot",
    ircAdmin: "wikimatze",
    ircOpts: getIrcOpts(),
    gitterApiKey: "",
    gitterRoom: "padrino/padrino-framework"
    }

    View Slide

  7. Hosting on uberspace
    uberspace is a German based
    hosting company where you
    decide what you want to pay.
    $ ssh fomalhaut.uberspace.de -l padrino
    [padrino@fomalhaut ~]$ git clone https://github.com/vimberlin/vimberlinbot.git
    [padrino@fomalhaut ~]$ cd vimberlinbot && ./bin.js

    View Slide

  8. Creating a permanent
    bot as a daemon
    You need to create a daemon
    https://wiki.uberspace.de/
    system:daemontools)
    [padrino@fomalhaut ~]$ test -d ~/service || uberspace-setup-svscan
    Creating the /etc/run-svscan-padrino/run script
    Symlinking /etc/run-svscan-padrino to /service/svscan-padrino to start the service
    Waiting for the service to start ... 1 2 3 4 5 started!
    Congratulations - your personal ~/service directory is now ready to use!

    View Slide

  9. Create a service
    [padrino@fomalhaut service]$ uberspace-setup-service vimberlinservice npm start
    Creating the ~/etc/run-vimberlinservice/run service run script
    Creating the ~/etc/run-vimberlinservice/log/run logging run script
    Symlinking ~/etc/run-vimberlinservice to ~/service/vimberlinservice to start the service
    Waiting for the service to start ... 1 2 3 started!
    Congratulations - the ~/service/vimberlinservice service is now ready to use!
    To control your service you'll need the svc command (hint: svc = service control):

    View Slide

  10. Edit the job
    [padrino@fomalhaut]$ vim
    ~/service/
    vimberlinservice/run
    #!/bin/sh
    # These environment variables are sometimes needed by the running daemons
    export USER=padrino
    export HOME=/home/padrino
    # Include the user-specific profile
    source $HOME/.bash_profile
    # Now let's go!
    cd /home/padrino/vimberlinbot && exec /usr/local/bin/npm start

    View Slide

  11. Start the service:
    [padrino@fomalhaut]$ svc -u ~/service/vimberlinservice

    View Slide

  12. Delete the daemon
    [padrino@fomalhaut]$ cd ~/service/vimberlinservice
    [padrino@fomalhaut service]$ rm ~/service/vimberlinservice
    [padrino@fomalhaut service]$ svc -dx . log
    [padrino@fomalhaut service]$ rm -rf ~/etc/run-vimberlinservice

    View Slide

  13. Who am I
    @wikimatze
    writing @padrinobook
    running @vimberlin
    updating @padrinorb
    and …

    View Slide

  14. One last thing

    View Slide