Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Communications > Chat

    artie 0.1

    Download button

    No screenshots available
    Downloads: 276  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sumeet Agarwal | More programs
    MIT/X Consortium Lic... / FREE
    July 6th, 2010, 17:30 GMT
    ROOT / Communications / Chat

     Read user reviews (0)  Refer to a friend  Subscribe

    artie description

    IRC utility robot framework for Python

    artie is an IRC robot that is dead simple to extend. Perfect for accessing Internet APIs or scraping webpages.

    Installation

    To install, the latest release pip install artie or easy_install artie.

    For the bleeding edge, get the source from GitHub and python setup.py install.

    Getting started

    Make a new config file. The default name is settings.yaml. Follow the example config:

    NICK: artie
    USERNAME: artie
    REALNAME: artie
    SERVER: irc.efnet.net
    PORT: 6667
    CHANNELS:
     - '#goobtown'
    APPLICATION_PATH: /home/sumeet/artiebot/applications # (Optional)


    Start your bot with artie-run.py or artie-run.py < configuration_file >.

    Quick example application

    To make a new application, just make a .py file in the APPLICATION_PATH. If you don't set the application path, it'll be the applications directory in the same path as your settings file.

    hello.py

    from artie.applications import trigger
    from artie.helpers import work_then_callback
    from time import sleep

    # Matched groups from the regular expression below get passed into the
    # decorated function.
    @trigger(r'^.hello (.*)$')
    def hello(irc, argument):
     """
     Responds back to the same channel like so:

     < user > .hello artie
     < artie > Hi, user. You said artie.
     """
     def _respond(text):
     irc.reply('Hi, %s. You said %s.' % (irc.message.nick, text))

     def _do_work(text):
     sleep(1)
     return text

     work_then_callback(_do_work, _respond, work_args=[argument,])


    It's that easy. work_then_callback runs _do_work asynchronously and passes the return value to _respond. You'll want to use work_then_callback like this if you intend to use artie to access the Internet.

    artie also makes it easy to do timed events:

    hello_timer.py

    from artie.applications import timer

    @timer(10)
    def test(irc):
     """
     Sends a message to every channel the bot is in every 10 seconds.
     """
     for channel in irc.channels:
     irc.msg(channel, 'hi i am artie')


    For more examples, check out the sample project.

    Reloading applications

    If you've made changes to applications or added new ones, send artie a SIGHUP to reload your applications directory.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    robot framework | IRC robot | IRC | robot | framework

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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