IRC Hacks

Book description

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.

Publisher resources

View/Submit Errata

Table of contents

  1. Foreword
  2. Credits
    1. About the Author
    2. Contributors
    3. Acknowledgments
  3. Preface
    1. Why IRC Hacks?
    2. How to Use This Book
    3. How This Book Is Organized
    4. Conventions Used in this Book
    5. Using Code Examples
    6. How to Contact Us
    7. Got a Hack?
  4. 1. Connecting to IRC
    1. Introduction: Hacks #1-4
    2. IRC from Windows
    3. IRC from Linux
      1. Nicknames, Usernames, and Real Names
      2. Server Configuration
      3. Advanced Options and Autoconnects
      4. Setting Up Autologin
      5. Selecting a Stable Server
      6. Different Nicknames on Different Networks
      7. Setting Up the User Interface
        1. Interface/Text Box
        2. Chatting/General
        3. Logging
        4. Network/Setup
      8. Hacking XChat
        1. Tab in a window
        2. Per-channel options
        3. All-server commands
        4. Use colors
        5. Display output with /exec
        6. Setting up auto-replace strings
        7. Setting up user commands
        8. Customize messages/colors and set sounds
        9. Add user list buttons and menu commands
        10. Add CTCP replies
    4. IRC from Mac OS X
      1. Conversation
      2. X-Chat Aqua
      3. Snak
      4. IRCle
    5. IRC with ChatZilla
      1. Installing ChatZilla
      2. Using ChatZilla
      3. See Also
  5. 2. Using IRC
    1. Introduction: Hacks #5-11
    2. The IRC Model
      1. Network of Servers
      2. Clients
      3. Channels
      4. Operators
      5. Channel Operators
    3. Common Terms, Abbreviations, and Phrases
      1. Noun-Verb Duality
      2. Leet Speak
      3. Correction Syntax
      4. Phonetics and Keyboard Layouts
    4. Common Acronyms and Initialisms
    5. Register with NickServ
      1. Registering Yourself with NickServ
      2. Fixing Nick Collisions
      3. Changing Nicknames
    6. Register Your Channel with ChanServ
      1. Introducing ChanServ
      2. Registering a Channel
      3. Restoring Channel Operators
      4. Access Lists
      5. Adding Users to the Access List
      6. Other ChanServ Features
    7. The QuakeNet L Channel Bot
      1. Create an Account
      2. Getting L
      3. Setting Up L for Your Channel
    8. Fix Channel Problems with CHANFIX
      1. Channel Monitoring
      2. Automatic CHANFIX
      3. Manual CHANFIX
      4. Interesting CHANFIX Facts
      5. See Also
  6. 3. Users and Channels
    1. Introduction: Hacks #12-16
    2. Find Relevant Channels and Servers
      1. Finding Help on IRC
      2. Other Interesting Statistics
    3. Guess the Time Zone of a User
    4. Study Channel Statistics with pisg
      1. Running pisg
        1. Editing pisg.cfg
      2. Publishing pisg Statistics
        1. Setting up statistics options
        2. Nickname tracking
        3. User lines
        4. Photos and photo galleries
        5. Headers and footers
      3. The Results
    5. Find Users in Channels
      1. Nick Seeking
      2. Advanced Search
      3. A Strategy for Finding Users
      4. The Code
        1. Finding users with Net::IRC
        2. irssi
        3. PircBot
    6. Filter Channel Lists
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
  7. 4. Enhancing IRC Clients
    1. Introduction: Hacks #17-30
    2. Automatic Completion of Nicknames
      1. mIRC
      2. irssi
      3. XChat
      4. ChatZilla
      5. BitchX
    3. Add Timestamps to mIRC Messages
      1. Adding Simple Timestamps
      2. Hacking the Timestamp
    4. Highlight Lines in mIRC
      1. Highlight Your Own Messages
      2. Highlight Messages from Other People
      3. Highlight Messages Containing Keywords
    5. Automate mIRC with Scripting
      1. Opening the Scripts Editor
      2. Making a Bad Word Banner
        1. alias
        2. set
        3. while
        4. if
        5. return
        6. inc
      3. Putting It All Together
        1. on TEXT
        2. if
        3. mode
        4. kick
      4. Running the Hack
    6. Format Text
      1. Formatting Text in mIRC
        1. Bold
        2. Underline
        3. Italic or reversed
        4. Normal
      2. Formatting Text with a Bot
        1. Bold
        2. Underline
        3. Italic or reversed
        4. Normal
      3. Formatting Text with PircBot
    7. Colorize Text
      1. Using Colors in mIRC
      2. Backgrounds
      3. Problems with Coloring Numbers
      4. Sending Colors from Bots
      5. Sending Colors from PircBot
    8. Play Sounds
      1. Enabling Sound Requests
      2. Adding Sounds to mIRC
      3. Sending Sound Requests
      4. Requesting Sounds
      5. Agents
    9. Enhance irssi with Perl
      1. Using an irssi Script
      2. See What Film Everyone’s Watching
      3. Who’s Behind That Nick?
      4. Strange Dialects
      5. Automatically Get Ops When the Channel Is Empty
      6. Keep Everyone Amused When You’re Away
      7. What Was That Query About Again?
      8. Other Interesting Scripts
      9. The Code
    10. Connect to Multiple Servers
      1. mIRC
      2. XChat
      3. irssi
    11. Secure Your IRC Connection with SSL
      1. Securing Your IRC Connection with mIRC
      2. Securing Your IRC Connection with XChat
      3. Securing Your IRC Connection with irssi
      4. Securing Your IRC Connection with stunnel
    12. Tunnel Your IRC Connection with SSH
      1. Setting Up an SSH Tunnel with OpenSSH
      2. Setting Up an SSH Tunnel with PuTTY
      3. Allowing Third Parties to Bypass the Firewall
    13. Automate Voice Management
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    14. Make IRC Talk
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    15. Add Your IRC Nickname to Your Webcam
      1. Writing Your Nickname to a File
      2. Displaying File Contents in Dorgem
      3. The Results
  8. 5. Writing IRC Bots
    1. Introduction: Hacks #31-39
    2. IRC Over Telnet
      1. Staying Alive
      2. Joining Channels and Sending Messages
    3. A Simple Perl IRC Client
      1. The Code
      2. Running the Hack
      3. The Results
    4. IRC with Perl and Net::IRC
      1. Preparations
      2. The Code
      3. Running the Hack
      4. The Results
    5. A Simple Java IRC Client
      1. The Code
      2. Running the Hack
      3. Results
    6. IRC with Java and PircBot
      1. Event-Driven Framework
      2. Running the Hack
      3. Hacking the Hack
    7. A Simple Python IRC Client
      1. The Code
      2. Running the Hack
    8. IRC with Python and IRCLib
      1. The Code
      2. Event Handlers
      3. Learning More About IRCLib
    9. Extend the Python IRCLib
      1. The Code
      2. Loading Your Extensions
      3. Built-in Extensions
    10. The Ethics of IRC Bots
  9. 6. Logging Bots
    1. Introduction: Hacks #40-43
    2. Keep Tabs on People
      1. !seen
      2. The Code
      3. Running the Hack
      4. Hacking the Hack
    3. Log URLs People Mention
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    4. Blog from IRC
      1. The Code
      2. Running the Hack
      3. The Results
    5. A Continuity Bot
      1. The Code
      2. Running the Hack
  10. 7. Community Bots
    1. Introduction: Hacks #44-50
    2. Infer Social Networks from IRC
      1. Installing PieSpy
      2. Configuring PieSpy
      3. Running PieSpy
      4. Getting Output from PieSpy
      5. Controlling PieSpy
      6. The Results
    3. Run an Infobot
      1. Getting Infobot
        1. Configuration
      2. Set Up Users
      3. Using the Infobot
      4. Reprogramming the Infobot
    4. Use PPF for Gaming Clans
      1. Get PPF
      2. PPF Core
      3. Running PPF
      4. ChannelCentral
      5. TriggerMessage
      6. ServerQuery
      7. ServerAdminShouter
      8. CBFinder
      9. BFTracks
      10. EDFinder
      11. Google
      12. Other Plug-ins
    5. Write a Plug-in for PPF
      1. The Code
      2. Running the Hack
      3. Creating Advanced Plug-ins
    6. Getting Friendly with FOAFBot
      1. Parsing a FOAF File
      2. Crawling FOAF Files
      3. Writing the IRC Interface
      4. Running the Hack
    7. Interrogate Trust Networks with TrustBot
      1. Getting Trust Data
      2. Modifying the IRC Interface
      3. The Results
    8. Pass Notes to Other Users
      1. The Code
      2. Running the Hack
      3. The Results
  11. 8. Search and Query Bots
    1. Introduction: Hacks #51-57
    2. Search the Web with Google
      1. Google Web APIs
      2. The Code
      3. Running the Hack
      4. The Results
    3. Use the Dictionary
      1. The Code
      2. Running the Hack
      3. The Results
      4. Hacking the Hack
    4. Check the Weather
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    5. Don’t Get Lost in Translation
      1. The Code
      2. Running the Hack
    6. Convert Currency
      1. The Code
      2. Running the Hack
    7. Find Out When People Are on the Network
      1. The Code
      2. Running the Hack
      3. The Results
    8. Search for Books on Amazon
      1. The Code
      2. Running the Hack
      3. Using the Bot
      4. Hacking the Hack
  12. 9. Fun Bots
    1. Introduction: Hacks #58-63
    2. A DiceBot
      1. The Code
      2. Running the Hack
      3. The Results
    3. An Egg Timer
      1. The Code
      2. Running the Hack
      3. The Results
      4. Hacking the Hack
    4. A Trivia Bot
      1. The Code
      2. Making Questions
      3. Running the Hack
      4. The Results
    5. Perform Feats of Math
      1. Java Expression Parser
      2. The Code
      3. Running the Hack
    6. An Artificial Intelligence Bot
      1. Markov Modeling
      2. JMegaHal
      3. The Code
        1. A simple example
        2. Combining JMegaHal and PircBot
      4. Running the Hack
      5. The Results
    7. Create Comic Strips
      1. Setting Up ComicBot
      2. Running ComicBot
      3. Comic Strip Templates
  13. 10. Announcement Bots
    1. Introduction: Hacks #64-67
    2. Welcome Visitors Automagically
      1. Channel Rules
      2. Welcome Options
      3. The Code
      4. Running the Hack
      5. The Results
    3. Announce Newsgroup Posts
      1. Connecting to a News Server
      2. The Code
      3. Running the Hack
      4. The Results
    4. Feed Syndicated RSS News
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    5. Watch Online Games with MatchEd
      1. Configuring MatchEd
      2. Starting MatchEd
      3. Message Styles
        1. Dynamic configuration
  14. 11. Network Bots
    1. Introduction: Hacks #68-72
    2. Link Channels on Multiple Networks
      1. The Code
      2. Running the Hack
      3. The Results
    3. Get a Remote Shell
      1. DCC
      2. The Code
      3. Running the Hack
      4. The Results
      5. DCC CHAT Limitations
    4. Tail Log Files
      1. The Code
      2. Running the Hack
      3. The Results
    5. Bridge Two Infobots
      1. The Code
      2. Running the Hack
    6. A File-Sharing Bot
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
      4. The Results
  15. 12. Channel Management Bots
    1. Introduction: Hacks #73-77
    2. Protect the Channel Topic
      1. Topic Protection Mode
      2. Topic Erasure
      3. Formatting and Colors
      4. Profanity Filtering
      5. The Code
      6. Running the Hack
    3. Invite Users into Channels
      1. Create an InviteBot
      2. The Code
      3. Running the Hack
      4. The Results
    4. Maintain Operator Status
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    5. Set Up an Eggdrop Bot
      1. Configuring Eggdrop
    6. Manage Channels with an Eggdrop
      1. Joining Channels
      2. Adding Users
      3. Flood Protection
  16. 13. The IRC Protocol
    1. Introduction: Hacks #78-85
    2. Understanding the IRC Protocol
      1. Asynchronous by Nature
      2. The Protocol
        1. Message
        2. PRIVMSG
        3. NOTICE
        4. PING/PONG
    3. Text Over Multiple Lines
      1. Avoiding the Problem
    4. Fake an Ident Response
      1. The Code
      2. Running the Hack
      3. Firewalls and Ident
    5. Strip Formatting from Messages
      1. TimeBot Scenario
      2. Removing All Formatting
        1. Perl solution
        2. Python solution
        3. Java solution
        4. Java Applet solution
    6. Remove Color from Messages
      1. Simple Color Removal
        1. Perl solution
        2. Python solution
        3. Java solution
        4. Java Applet solution
      2. Hacking the Hack
    7. Encrypt Messages
      1. Key Encryption
      2. The Code
      3. Running the Hack
      4. The Results
    8. Timestamp with the TS Protocol
      1. Before TS
      2. TS Saves the Day
      3. Interesting TS Facts
    9. Understanding CTCP Messages
      1. Tagged Data
      2. Queries
  17. 14. Other Ways to Connect to IRC
    1. Introduction: Hacks #86-94
    2. Hypertext Links to IRC Channels
      1. HTML IRC Links
      2. Example Links
    3. IRC from Your Mobile Phone
    4. Enemies of Mobile IRC
      1. The Phone Keypad
      2. Predictive Text Entry
      3. Small Screen Size
      4. Street Traffic and Street Furniture
      5. Dropped Connections
      6. Others Unaware Your Client Is Limited
      7. The Ephemeral Nature of Sessions
      8. Battery Life
    5. IRC from a Pocket PC
    6. Access IRC with Java Applets
      1. Customizing PJIRC
        1. nick
        2. alternativenick
        3. host
        4. alternativeserver
        5. command
        6. authorizedjoinlist
        7. authorizedcommandlist
      2. The Results
    7. Use IRC from a Web Page Without Java
      1. Installing CGI:IRC
    8. Use IRC Within screen
    9. Set Up an IRC Proxy
      1. Setting Up CtrlProxy
      2. Running the Hack
      3. Advanced Features
    10. Use irssi and Its Proxy
      1. Connecting to a Server
      2. Using the irssi Proxy
  18. 15. Servers and Services
    1. Introduction: Hacks #95-100
    2. Set Up Your Own IRC Server for Unix/Linux
      1. Installing Unreal
    3. Install Services
      1. Configuring the IRC Server
      2. Configuring Services
      3. Running the Services
    4. Set Up Your Own beware ircd Server
      1. Downloading beware ircd
      2. O:Lines
      3. Running beware ircd
    5. Link Two IRC Servers Together
      1. Configuring the Servers
      2. Numerics
      3. C:Lines
      4. Linking the Servers
      5. Bursting
      6. Commands
    6. Use MSN/ICQ/Jabber from IRC
      1. Installation
      2. Using BitlBee
      3. More Than Just Talking
    7. Combine BitlBee and CtrlProxy
      1. Setting Up CtrlProxy and BitlBee
      2. Starting CtrlProxy
      3. Starting the Session
      4. Hacking the Hack
  19. Index
  20. About the Author
  21. Colophon
  22. Copyright

Product information

  • Title: IRC Hacks
  • Author(s): Paul Mutton
  • Release date: July 2004
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596006877