Giter VIP home page Giter VIP logo

jabberbot's Introduction

Jabber Bot

Requirements

node (of course)

On a mac, install with brew!

brew install node

npm (of course)

Run:

curl https://npmjs.org/install.sh | sh

On a mac, install with brew!

brew install icu4c
brew link icu4c

npm: simple-xmpp

Install via:

npm install -g simple-xmpp

Configuring

Once you've installed all the requirments, you will need to configure your bot.

cp config-example.js config.js
vi config.js
Setting Wat?
process.env.bot_send_to The jabber account your bot will send messages to. (i.e. your gtalk account)
process.env.bot_listen_port The port your bot will listen on.
process.env.bot_jid The jabber account your bot will log in as in order to send debug messages.
process.env.bot_password The password for your bot's jabber account.
process.env.bot_host The jabber host. Default: talk.google.com
process.env.bot_port The jabber host port. Default: 5222

Note: you'll need to create a jabber account somewhere so this will all work. If you don't have your own domain name, using Gmail is always an option. Once you've created your bot's account, you'll need to log in as your bot via a chat client and invite your primary account as a friend.

Obviously, replace SOME.IP.ADD.RESS with the IP address that you expect to receive UDP packets from.

Running the Bot

Run this bad boy like so:

node bot.js

Punching a hole in your firewall (if required)

If you plan on accepting UDP traffic from a host other than your local host, you'll probably need to punch a hole in your firewall.

Check to see what you have in ipfw:

sudo ipfw list

Choose a sequence number for your firewall rule (this example uses the number 10):

sudo ipfw add 10 allow udp from SOME.IP.ADD.RESS to any 8888

Running as a process

If you, like me, want to have this bad boy running any time you need it, you can set it up as a process using forever, a handy npm. To get it, run:

sudo npm install -g forever

Then, to forever run the bot, simply:

cd /path/to/jabberbot
forever bot.js

jabberbot's People

Contributors

borkweb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.