[Konversation-devel] store: simple key/value storage script

Melchior FRANZ mfranz at kde.org
Thu Nov 8 21:58:06 CET 2007


Hi,

attached is a simple script that stores key/value pairs and
displays or sends a value for a given key. I use this in a
software support channel (irc://irc.flightgear.org/#flightgear),
where the same URLs are needed again and again (and where we
don't have a bot for that). If you want to include it in the
scripts/ dir, go ahead. If not, then just pretend I never
mentioned it.  :-)


From the header:

  For each of the commands "list", "set", "unset", "get", and "post"
  define a command alias that puts it as argument to the store script:

    list   -> /exec store list
    set    -> /exec store set
    unset  -> /exec store unset
    get    -> /exec store get
    post   -> /exec store post
 
  Then use these commands like so:
 
    /list  [<regex>]     ... list all entries [that match the regex]
    /set   <key>=<value> ... store key/value pair (spaces around '=' allowed)
    /unset <key>         ... remove key/value pair
    /get   <key>         ... display value for key (but don't send)
    /post  <key>         ... send value for key


And it works like this:

  /set carrier=http://wiki.flightgear.org/flightgear_wiki/index.php?title=Carrier_Howto
  ...
  <newbie> How can I land on the aircraft carrier?
  /post carrier
  <me> http://wiki.flightgear.org/flightgear_wiki/index.php?title=Carrier_Howto

m.  :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: store
Type: application/x-perl
Size: 3083 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/konversation-devel/attachments/20071108/f012c1ee/attachment.pm 


More information about the Konversation-devel mailing list