Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

hex (3272)

  (email not shown publicly)

Perl, RDF and wiki hacker, London, UK. This is my former Perl blog; I now write at Earle's Notebook [].

Journal of hex (3272)

Thursday July 04, 2002
04:14 PM


[ #6180 ]

As mentioned earlier, I now have wikibot working, at least in primitive form. I made it because I like wikis a lot and would like to be able to dump stuff into them straight from IRC.[0]

What it does: Like scribot, it's a bot that sits on an IRC channel, takes things told it by users and puts them onto a web page. However, wikibot, as you might guess, puts said things onto a page of a wiki, rather than a flat blog-type page. Thus allowing you to dive into the page and dick around with whatever you wikibotted, move stuff around, create structure or what-have-you. You can also take advantage of wiki features such as WikiLinks, etcetera.

How it works: The bot connects to IRC using the Net::IRC module, and, upon being called, will retrieve the contents of a wiki page's edit page[1] using LWP::UserAgent, grab the content out of the retrieved page, append the new data to that content, and then POST it back to the wiki.

Problems with it at the moment that I can see:

  • No bot help.
  • Configuration options are hardcoded.
  • It only works with UseModWiki.
  • What happens if the page you're editing gets really big?

Apparently this POE::Component::IRC (did I get that right?) business is rather good. I don't know squat about it at the moment, so I need to look at that. Related to that is Trelane's bot framework, as also mentioned earlier - it may be worth switching it to run on that.

I'm still mulling things that it could do in the future; suggestions are welcome. One thing is perhaps taking arguments for what page to write to, like wikibot: Foo / yak yak yak where Foo is the page name, or something like that. I have a few other fuzzy notions, but I won't commit them to paper - so to speak - just yet.

The code is running in #bots on - called "accretor". Try it out if you like: anything you tell it goes, for the moment, here (it's meant to go to accretion, but there are some issues with the server where that's hosted, so not yet).

[0] In particular, a wiki called accretion that zool and I, and hopefully others, are using to accumulate links to content about the things that are driving our minds right now, bots amongst other things.

[1] Every page on a wiki is editable; clicking the "edit this page" will take you to a page with a form for editing it, and this is what I mean. Kind of like when you edit one of your journal entries here.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Very cool. Some thoughts:

    1. Yes POE is good. Try POE::Component::IRC::Object - it's quite a lot like working with Net::IRC, but you get all the niceties of POE (such as doing your web lookups/posts can be non-blocking, allowing the bot to continue reading more edits.

    2. If you used AxKit Wiki, you could retreive the XML unstyled, so you'd get something like: <edit><text>wikiwiki text here</text></edit>, making it a wee bit easier to parse and append to (probably not a big deal thoug