Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Communications > Chat

    python-jabberbot 0.15

    Download button

    Downloads: 1,439  Tell us about an update
    User Rating:
    Rated by:
    Good (3.1/5)
    20 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Thomas Perl | More programs
    GPL v3 / FREE
    March 8th, 2012, 23:26 GMT [view history]
    ROOT / Communications / Chat

     Read user reviews (0)  Refer to a friend  Subscribe

    python-jabberbot description

    A Jabber bot framework for Python that makes it easy to write simple Jabber bots.

    python-jabberbot application is a Jabber bot framework for Python that makes it easy to write simple Jabber bots. One can use these Jabber bots to provide information about running systems, to make Web sites interact with Jabber-enabled visitors, or notify the bot owner about updates or changes that are monitored with custom Python scripts.

    Programming your own Jabber bot can be fun and helpful. This is python-jabberbot, a Jabber bot framework for Python that enables you to easily write simple Jabber bots. You can use your Jabber bots to provide information about your running systems, to make your website interact with your visitors or notify you about updates or changes you monitor with your Python scripts.

    This Jabber bot is partly inspired by the xmpppy example bot.py, but designed to be re-usable and to make it easy to write small Jabber bots that do one thing and do it well.

    Usage:

    � Import the class: from jabberbot import JabberBot
    � Subclass the JabberBot class
    � Add methods starting with bot_, these will be exported as commands (e.g. def bot_display_id( self, mess, args)); the methods should return the message sent back to the user as string (or None if the command gives no reply)
    � Create an instance of your bot, supplying username and password
    � Call the serve_forever() method of your instance
    � You can call the send() method on your bot to send messages to specific users

    Example code:

    from jabberbot import JabberBot
    import datetime

    class SystemInfoJabberBot(JabberBot):
    def bot_serverinfo( self, mess, args):
    """Displays information about the server"""
    version = open('/proc/version').read().strip()
    loadavg = open('/proc/loadavg').read().strip()

    return '%snn%s' % ( version, loadavg, )

    def bot_time( self, mess, args):
    """Displays current server time"""
    return str(datetime.datetime.now())

    def bot_rot13( self, mess, args):
    """Returns passed arguments rot13'ed"""
    return args.encode('rot13')

    def bot_whoami( self, mess, args):
    """Tells you your username"""
    return mess.getFrom()

    username = 'my-jabberid@jabberserver.org'
    password = 'my-password'
    bot = SystemInfoJabberBot(username,password)
    bot.serve_forever()



    Product's homepage

    Requirements:

    · Python
    · Xmpppy

    What's New in This Release: [ read full changelog ]

    · various bugfixes and minor feature enhancements

      


    TAGS:

    Jabber bot | Python framework | write Jabber bots | python-jabberbot | Jabber | bot

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM