SunQuest
 
       Python
  Home arrow Python arrow Page 4 - Basic IRC Tasks
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Basic IRC Tasks
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2005-04-18

    Table of Contents:
  • Basic IRC Tasks
  • Communication Tasks
  • Channel Related Tasks
  • User Related Tasks
  • Processing Information

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Basic IRC Tasks - User Related Tasks


    (Page 4 of 5 )

    The “WHO” command matches a pattern against users on a network:

    WHO pattern

    For example, let's say you wanted to search for everyone whose username began with “K”:

    WHO K*

    Let's create a method that queries the server with the “WHO” command:

    def who ( self, pattern ):

       self.send ( 'WHO ' + pattern )

    We can also request information on an indivudal using the “WHOIS” command:

    WHOIS user

    Creating a Python method that uses this command is, of course, easy:

    def whois ( self, nick ):

       self.send ( 'WHOIS ' + nick )

    Lastly, we can look up information on a user that has changed his or her nickname or has left the network using “WHOWAS”:

    WHOWAS user

    And here's the Python method:

    def whowas ( self, nick ):

       self.send ( 'WHOWAS ' + nick )

    More Python Articles
    More By Peyton McCullough


       · One thing though, your code does not take into account the IRC PING command, so your...
       · The source (...!...@...) on the beginning of the message is not mandatory. The first...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway