IRC (Internet Relay Chat) may very well turn out to be the world's most successful hack. In 1988, Jarkko Oikarinen wrote the original IRC program at the University of Oulu, Finland. As he says in his foreword, "IRC started as one summer trainee's programming exercise. A hack grew into a software development project that hundreds of people participated in, and then became a worldwide environment where tens of thousands of people now spend time with each other. I have found many of my friends through IRC and learnt a significant part of my present software engineering knowledge while using and working with IRC. That would not have been possible without learning from code examples and hacks from others".IRC has continued to grow in popularity since its inception. Millions of people from all over the world now use IRC to chat with friends, discuss projects and collaborate on research. With a simple, clearly defined protocol, IRC has become one of the most accessible chat environments, with clients written for a multitude of operating systems. And IRC is more than just a simple chat system it is a network of intercommunicating servers, allowing thousands of clients to connect from anywhere in the world using the IRC protocol.While IRC is easy to get into and many people are happy to use it without being aware of what's happening under the hood, there are those who hunger for more knowledge, and this book is for them. IRC Hacks is a collection of tips and tools that cover just about everything needed to become a true IRC master, featuring contributions from some of the most renowned IRC hackers, many of whom collaborated on IRC, grouping together to form the channel #irchacks on the freenode IRC network (irc.freenode.net).Like all of our Hacks books, there are many different ways to use IRC Hacks. You can read the book from cover to cover, but you might be better served by picking an interesting item from the table of contents and just diving in.If you're relatively new to IRC, you should considering starting with a few hacks from each progressive chapter. Chapter 1 starts you off by showing you how to connect to IRC, while Chapter 2 acquaints you with the everyday concepts you'll need to use IRC effectively. Chapter 3 is all about users and channels, and introduces the first pieces of code. Chapter 4 shows you how to make useful enhancements to IRC clients.Chapter 5 is where you will learn the basics about creating IRC bots, with Chapters 6-12 introducing more complex bots that can be used for logging, servicing communities, searching, announcing, networking, managing channels or simply for having fun. Chapter 13 delves into the IRC protocol in more detail, and Chapter 14 demonstrates some interesting alternative methods for connecting to IRC. Finally, Chapter 15 will move you on to new pastures by showing you how to set up your own IRC server.This book presents an opportunity to learn how IRC works and how to make best use of some of the features that have made it the most successful, most scalable, and most mature chat system on this planet. IRC Hacks delves deep into the possibilities.
Paul Mutton is a PhD student at the University of Kent in the UK, frantically trying to finish off his thesis at the same time as writing this book. He previously graduated with first class honors in Computer Science, winning the IEE Institution Prize for being the best overall student in his department. He uses IRC to collaborate with researchers in other countries and to talk to people in his office when they have their headphones on. In his remaining spare time, he uses his Sun Certified Java Programmer skills to develop all sorts of open source software on his personal web site (http://www.jibble.org). Some of his research has culminated in the creation of the popular PieSpy application (http://www.jibble.org/piespy/), which infers and visualizes social networks on IRC, and even appeared on slashdot once. He can normally be found jibbling around in #jibble and #irchacks on the freenode IRC network with the nickname Jibbler, or Paul on smaller networks.
Foreword;
Credits;
About the Author;
Contributors;
Acknowledgments;
Preface;
Why IRC Hacks?;
How to Use This Book;
How This Book Is Organized;
Conventions Used in this Book;
Using Code Examples;
How to Contact Us;
Got a Hack?;
Chapter 1: Connecting to IRC;
1.1 Introduction: Hacks #1-4;
1.2 IRC from Windows;
1.3 IRC from Linux;
1.4 IRC from Mac OS X;
1.5 IRC with ChatZilla;
Chapter 2: Using IRC;
2.1 Introduction: Hacks #5-11;
2.2 The IRC Model;
2.3 Common Terms, Abbreviations, and Phrases;
2.4 Common Acronyms and Initialisms;
2.5 Register with NickServ;
2.6 Register Your Channel with ChanServ;
2.7 The QuakeNet L Channel Bot;
2.8 Fix Channel Problems with CHANFIX;
Chapter 3: Users and Channels;
3.1 Introduction: Hacks #12-16;
3.2 Find Relevant Channels and Servers;
3.3 Guess the Time Zone of a User;
3.4 Study Channel Statistics with pisg;
3.5 Find Users in Channels;
3.6 Filter Channel Lists;
Chapter 4: Enhancing IRC Clients;
4.1 Introduction: Hacks #17-30;
4.2 Automatic Completion of Nicknames;
4.3 Add Timestamps to mIRC Messages;
4.4 Highlight Lines in mIRC;
4.5 Automate mIRC with Scripting;
4.6 Format Text;
4.7 Colorize Text;
4.8 Play Sounds;
4.9 Enhance irssi with Perl;
4.10 Connect to Multiple Servers;
4.11 Secure Your IRC Connection with SSL;
4.12 Tunnel Your IRC Connection with SSH;
4.13 Automate Voice Management;
4.14 Make IRC Talk;
4.15 Add Your IRC Nickname to Your Webcam;
Chapter 5: Writing IRC Bots;
5.1 Introduction: Hacks #31-39;
5.2 IRC Over Telnet;
5.3 A Simple Perl IRC Client;
5.4 IRC with Perl and Net::IRC;
5.5 A Simple Java IRC Client;
5.6 IRC with Java and PircBot;
5.7 A Simple Python IRC Client;
5.8 IRC with Python and IRCLib;
5.9 Extend the Python IRCLib;
5.10 The Ethics of IRC Bots;
Chapter 6: Logging Bots;
6.1 Introduction: Hacks #40-43;
6.2 Keep Tabs on People;
6.3 Log URLs People Mention;
6.4 Blog from IRC;
6.5 A Continuity Bot;
Chapter 7: Community Bots;
7.1 Introduction: Hacks #44-50;
7.2 Infer Social Networks from IRC;
7.3 Run an Infobot;
7.4 Use PPF for Gaming Clans;
7.5 Write a Plug-in for PPF;
7.6 Getting Friendly with FOAFBot;
7.7 Interrogate Trust Networks with TrustBot;
7.8 Pass Notes to Other Users;
Chapter 8: Search and Query Bots;
8.1 Introduction: Hacks #51-57;
8.2 Search the Web with Google;
8.3 Use the Dictionary;
8.4 Check the Weather;
8.5 Don't Get Lost in Translation;
8.6 Convert Currency;
8.7 Find Out When People Are on the Network;
8.8 Search for Books on Amazon;
Chapter 9: Fun Bots;
9.1 Introduction: Hacks #58-63;
9.2 A DiceBot;
9.3 An Egg Timer;
9.4 A Trivia Bot;
9.5 Perform Feats of Math;
9.6 An Artificial Intelligence Bot;
9.7 Create Comic Strips;
Chapter 10: Announcement Bots;
10.1 Introduction: Hacks #64-67;
10.2 Welcome Visitors Automagically;
10.3 Announce Newsgroup Posts;
10.4 Feed Syndicated RSS News;
10.5 Watch Online Games with MatchEd;
Chapter 11: Network Bots;
11.1 Introduction: Hacks #68-72;
11.2 Link Channels on Multiple Networks;
11.3 Get a Remote Shell;
11.4 Tail Log Files;
11.5 Bridge Two Infobots;
11.6 A File-Sharing Bot;
Chapter 12: Channel Management Bots;
12.1 Introduction: Hacks #73-77;
12.2 Protect the Channel Topic;
12.3 Invite Users into Channels;
12.4 Maintain Operator Status;
12.5 Set Up an Eggdrop Bot;
12.6 Manage Channels with an Eggdrop;
Chapter 13: The IRC Protocol;
13.1 Introduction: Hacks #78-85;
13.2 Understanding the IRC Protocol;
13.3 Text Over Multiple Lines;
13.4 Fake an Ident Response;
13.5 Strip Formatting from Messages;
13.6 Remove Color from Messages;
13.7 Encrypt Messages;
13.8 Timestamp with the TS Protocol;
13.9 Understanding CTCP Messages;
Chapter 14: Other Ways to Connect to IRC;
14.1 Introduction: Hacks #86-94;
14.2 Hypertext Links to IRC Channels;
14.3 IRC from Your Mobile Phone;
14.4 Enemies of Mobile IRC;
14.5 IRC from a Pocket PC;
14.6 Access IRC with Java Applets;
14.7 Use IRC from a Web Page Without Java;
14.8 Use IRC Within screen;
14.9 Set Up an IRC Proxy;
14.10 Use irssi and Its Proxy;
Chapter 15: Servers and Services;
15.1 Introduction: Hacks #95-100;
15.2 Set Up Your Own IRC Server for Unix/Linux;
15.3 Install Services;
15.4 Set Up Your Own beware ircd Server;
15.5 Link Two IRC Servers Together;
15.6 Use MSN/ICQ/Jabber from IRC;
15.7 Combine BitlBee and CtrlProxy;
Colophon;