[development] Druplicon is dead! Long live Druplicon!

Morbus Iff morbus at disobey.com
Thu Jun 28 01:31:04 UTC 2007


I started running Druplicon as a Perl bot in 2005.

In late 2006, I started a proof of concept called bot.module.

Today, bot_module has officially slayed the Perl beast Druplicon and 
taken its rightful name: Druplicon, the bot, is now a Drupal module.

   http://drupal.org/project/bot

Along with this are some evolutionary features. Here are the help docs:

   <Morbus> Druplicon: help Factoids
   <Druplicon> Set factoids with "BOTNAME: cats are furry",
     "BOTNAME: Drupal is great.", "No, BOTNAME, Morbus is awesome.",
     "BOTNAME: Drupal is also powerful.", "BOTNAME: cheer is
     <action>cheers!", or "BOTNAME: ping is <reply>WHAT?!". Retrieve
     factoids with: "Drupal?" or "BOTNAME: cheer!" Forget factoids with
     "BOTNAME: forget ping". Factoids can be browsed online at
     <http://www.disobey.com/bot/factoids>.

   <Morbus> Druplicon: help Function Lookups
   <Druplicon> If api.module is installed, the bot can provide function
     lookups, triggered by "<function>?", based on the host's installed
     branches (which must have "short names" that match api.drupal.org).
     Branches besides the default (currently "5") can be specified with
     "<function>:<branch>?".

Besides the factoids being browseable on:

   http://www.disobey.com/bot/factoid

(which makes it very easy to find crappy factoids to "forget", hint, 
hint), there is now direct integration with api.module, as originally 
provided via code from Bdragon. By default, function requests work 
against the latest release:

   <Morbus> l?
   <Druplicon> l: Format an internal Drupal link. => l($text, $path,
     $attributes = array(), $query = NULL, $fragment = NULL, $absolute =
     FALSE, $html = FALSE) => http://api.drupal.org/api/5/function/l

You'll note that there's now a summary (provided by Doxygen), and that 
there's no longer a restriction on length (so no more "api-l?"). You'll 
also note the URL is keyed toward DRUPAL-5.

But, consider:

   <Morbus> l:HEAD?
   <Druplicon> l: Format an internal Drupal link. => l($text, $path,
     $options = array()) => http://api.drupal.org/api/HEAD/function/l

By specifying "<function>:<branch>", you can get the results of a 
particular branch. I am currently providing DRUPAL-5 and HEAD, updated 
daily. DRUPAL-5 is the default (so "l:5?" is the same as "l?"). I will 
contain to provide (starting with DRUPAL-5), the last two releases and 
the current HEAD. The default will always be the latest release. I am 
also pulling from contrib/docs/developer too.

Because factoids/infobot and the API lookups are now two different 
modules, we can annotate particular functions with useful information 
(assuming we use the default/no-branch version). Consider:

   <Morbus> t?
   <Druplicon> t: Translate strings to the current locale. => t($string,
     $args = 0) => http://api.drupal.org/api/5/function/t
   <Druplicon> Please be very careful about using !... if you
     don't want italics, use @ instead!

   <Morbus> url?
   <Druplicon> url: Generate a URL from a Drupal menu path. Will also
     pass-through existing URLs. => url($path = NULL, $query = NULL,
     $fragment = NULL, $absolute = FALSE) =>
     http://api.drupal.org/api/5/function/url
   <Druplicon> It will do path aliasing automatically;
     always use the "real" Drupal URL, not the path alias!

Finally, the bot is happy to complain about errors in our Doxygen:

   <Morbus> drupal_render?
   <Druplicon> drupal_render: [Doxygen summary is not one line. This
     is a bug. File core patch.] => drupal_render(&$elements) =>
     http://api.drupal.org/api/5/function/drupal_render

Please don't hesitate to file bugs at
http://drupal.org/project/issues/bot
or bug me about it in IRC. Thanks!

-- 
Morbus Iff ( sleep breeds sanity )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
aim: akaMorbus / skype: morbusiff / icq: 2927491 / jabber.org: morbus


More information about the development mailing list