/ Flatiron School

Getting familiar with IRC

I've tried to figure out why many of the engineers I know still use IRC even though it's such old technology. I've tried it but don't totally understand it. Since I'm learning to code, it's time to also learn IRC.

IRC stands for Internet Relay Chat. You can read the Wikipedia definition, but that really doesn't tell you much about why or how people use it in world that also has IM clients, Twitter, SMS, iMessage, and all the other ways that we have today to connect. Honestly I don't totally know why either but it's time to dive in and find out! I asked on Twitter if it's still something people find useful,

Screen_Shot_2014-07-21_at_8_48_27_AM

and the general consensus seems to be yes.

Since I'm learning Ruby, the example channel I'll join is the #ruby-lang room on freenode.net. Here's the address:
irc://irc.freenode.net/ruby-lang

But how do I actually use that? And after I'm in there what is ok, and what is verboten?

Reading the address

  • irc:// denotes that it's an IRC connection as opposed to the http that you see when getting a web page.
  • irc.freenode.net is the server, as you'd guess.
  • ruby-lang is the specific room or 'channel' that you are joining as it's called in IRC.

IRC Clients

There are lots of options. Dedicated clients like Colloquy and Limechat, or irssi on the command line, and it's also possible to use IRC inside of other chat clients like Adium. For even more simplicity, there are browser extensions for Chrome and Firefox that will let you connect to IRC in your browser. irssi is good but it can be hard to install. If you just want to get up and running Adium is a good choice because you can also use it with so many other chat services.

Joining a room

For this example we'll join the ##new2ruby channel that is quite active as of this writing.

On Adium

  1. Download Adium if you don't already have it
  2. File > Add Account > IRC
  3. Nickname: Enter your name on the server
  4. Hostname: irc.freenode.net
  5. Click 'Options'
  6. Here you will enter any rooms you want to join automatically /join ##new2ruby
  7. Ok

On Colloquy

  1. After opening Colloquy click 'Connect'
  2. Enter irc.freenode.net as the Chat Server and Connect
  3. Before joining the ##new2ruby room we might as well look around to see what else is happening on the server. Click the down arrow to see a list of all the rooms. After you're connected click 'Join Room'.  I'm going to join a couple rooms to see how conversations work.

That's it! You can see what people are talking about and participate as well. Rooms often have a code of conduct or set of rules that you will see open entering the channel or in the topic at the top of the room. It's always a good idea to read these to understand the community that you are participating in.

Next up, what are the commands.

Commands

This is the part I've always been confused about. You enter IRC commands in the same place that you post messages except that instead of just entering "Hi there" you begin the line with a slash and type the command with it's arguments. Beginning the message with a slash indicates that it is a command and it will not be sent to the room. If it is a /msg command it will be sent to the person you're messaging. Common commands are:

  • /help will usually give you a list of command options
  • /msg <nick> (message) to start a private chat with someone in the room. Ex. '/msg barry345 Hi Barry how's Lavon?'
  • /ignore <nick> - ignore the person with that nick in all rooms on the server. They will not be able to /msg you.
  • /whois <nick> Opens an info window for nick.
  • /away lets you set your status to away.
  • /topic Channels will often have a message at the top of the room called the topic. This command lets you reset that.

Registering on the IRC server

You don't have to register with a password on most IRC servers. If you don't you can just login with a nickname temporarily. But to be a part of the community I think you need a regular account that is yours and which people can recognize you by so it's time to register.

One of the things that always seemed weird to me about IRC is that to register, change my password or anything about my account I have to enter my password in the same place I send messages to the group. So I wanted to make sure I know what I'm doing before accidentally sending my password to 300+ people. To prevent the possibility of this, we'll open up a chat with the NickServ bot that manages accounts. This way, even if something does go wrong it won't be sent to everyone. In the message input enter,

  1. /msg NickServ This should open a private chat with the bot.
  2. In the private chat enter /msg NickServ REGISTER password me@me.com where password and email are your password and email.
NicServ msg

This is messaging the Nickname Server bot directly, telling it that you want to REGISTER using the password and email provided.  After registering you can also enter the command /msg NickServ SET ENFORCE ON to make sure no one can use your nick unless they login.

Starting a channel on the Freenode IRC server

Since this is a way to chat with people. Having a list of commands is nice it's just not the same as actually using it. If you'd like to try setting up your own room to try it with a few friends on Freenode. Freenode is mainly a network for people involved in open source software but there are also some random rooms.  To get started, open a message session with the ChanServ bot by typing /msg ChanServ Now that you're messaging the bot directly follow these instructions from BotBot.me. The BotBot instructions are about how to setup an invite only room which requires people to register. Really I'd like people to be able to try it with me with a low barrier to entry so I'm going to skip that step. I created the channel and set it up using these commands:

  1. /join ##your-room-name
  2. /msg ChanServ REGISTER ##your-room-name
  3. /msg ChanServ SET ##your-room-name GUARD ON
  4. /msg Chanserv SET ##your-room-name MLOCK +s

And now you're setup!

channel setup

Now that the room is setup you can invite people to it by giving them the address: irc://irc.freenode.net/your-room-name Try changing the topic, /msg, /query, maybe even /ignore to see what happens.

To make the barrier to entry as low as possible, you can have a friend join in 3 steps by:

  1. Installing CIRC in Chrome.
  2. After opening the extension connect to freenode with this command, /server irc.freenode.net
  3. Then join the room with the password by entering: /join ##your-room-name password

Even easier channel setup

There are a few companies out there that basically let you embed an IRC chatroom in a webpage. Kiwiirc is one of them that will let you do this for free. From their embed page you can get a link that will open IRC in the browser, or even get embed code to let you just embed an IRC chatroom on your own site. They have an interesting note about using it with projects "You can now link your GitHub project to your own IRC channel (or create one on freenode!) by embedding a button within your readme.md file. This can be generated using the form to the right and selecting the GitHub logo."

Speaking of bots

If you start playing with it, one of the really fun and powerful things about IRC is the ability to have bots that report on things or reply to comments automatically. People have been writing IRC bots for years so there are lots to choose from that do everything from report site errors to post gifs.

If you want to try building a IRC bot there is a Ruby framework called Cinch that I'll be trying in the near future.

There are a lot of modern alternatives to IRC that are less quirky and easier to understand (Slack!)  but it's still a technology worth having some familiarity with.