Archive for the ‘IRC’ tag
Creating a IRC (Internet-Relay-Chat) Client in Ruby – First Steps
Homer was the beginning of my IRC obsession. Homer was an IRC client for the Macintosh operating system in the 1990's. I still kind of remember what it looked like. It had a black background with white text. Everytime you typed something, a little animated Homer (Simpson) would dance around in the left hand corner of the screen. For years I would come home from school, hit the computer, and spend hours talking to people all over the world. IRC is and was the original chat (ok besides BBSess). It was fascinating.
The other day I was contemplating what kind of project I could work on that incorporates Ruby as the back-end and Shoooes as the front-end and IRC came to mind as a viable project idea. I asked the nice people at Stackoverflow how one might get started on this particular project idea (besides knowing Ruby and shoes), and they were nice enough to link me to some important documents. The wikipedia entry provided a good overall overview while the nitty gritty IRC specification details can be found in RFC 1459.
Pre-Existing Ruby Client
I did a quick search on google for 'IRC' and 'Ruby' and came across Lurker's Blog. Lurker coded a very basic command line IRC Client which already provides the following functionality:
What can it do?
1) join and talk to multiple channels, as well as handle private chats (what is just enough for most of the people out there)
2) change user mode
3) send any IRC command entered by user (but you do have to know what you are doing and you do it at your own risk)
4) receive dcc file sends (resume supported)
5) process dcc download queue
6) record channel conversations to file
Lurker's code (which can be found here), to me, seems like a perfect jumping-off point for understanding exactly how IRC works while providing the basic IRC functionality for my project. I messaged Lurker and asked if I could use some of his code in my project and he gave me his blessing. Over the next few weeks I intend to take the following steps towards my graphical Ruby IRC client.
- I'll first take time to understand Lurker's Pre-Existing Code. I'll go through the code, comment it, then talk about it's overall structure and methodology on this blog.
- Lay down Lurker's Pre-Existing code in the Model-View-Controller Framework. MVC is a powerful design pattern that helps isolate the guts of the code (The Controller) with the Graphical Front-End (The View). On this blog, I'll talk about how to implement MVC in Ruby.
- Design the GUI in Shoes. Make some pretty drawings. Post them online.
- Code the GUI in Shoes based on the pre-existing basic IRC functionality.
- Continue to add additional features to Luker's basic IRC code as the need arises.
