• Welcome to The Campaign Builder's Guild.
 

IRC Chat and Cool New Wiki Stuff

Started by Hibou, March 01, 2016, 11:11:50 PM

Previous topic - Next topic

Hibou

Hey everyone,

So, as those of you who've been around the IRC Chat recently might have heard, I've been working on some Wiki-related stuff. More specifically, I've been working on a plugin for AztecBot that'll let users use commands to pull a short summary of existing CBG Wiki articles, followed by a link, into the chat. This was originally inspired by the existing Wikipedia plugin I've seen some of you guys play with, and now the CBG Wiki equivalent provides essentially the same service for our own website. My intent with creating this tool was to help promote the CBG Wiki, and make it a little more interesting and accessible for everyone to use. I'd like to eventually extend it so that it can print out summaries of specific subsections, not just page descriptions.

I'd like to ask you guys to give it a go when you hop into the chat next, as I'm still working out the kinks, and no doubt there'll be some issues (I will list what I know of below). The tool is still very experimental, so it's entirely possible that it'll break or crash the bot entirely during use. I'll start leaving the bot in the chat as much as possible so everyone can give it a go. If anyone has any odd experiences using this, suggestions, or other ideas related to the tool or the bot, feel free to post here in the thread.

Also, if anyone wants to see the code, you can find it here https://github.com/digwiz/Sopel_Plugins

Commands

These are pretty simple: use either !cbgw or !cbgwiki, followed by the name of the setting or article you want to look for. Here are some examples of what you'll see:

!cbgw Jade Stage will return "[CBG Wiki] Jade Stage | "Welcome to the Jade Stage wiki! This page marks a new attempt to archive and present information related to the Jade Stage, a setting involving the fictional world of Marebo, painstakingly detailed by ..." | http://www.thecbg.org/wiki/index.php?title=Jade_Stage"

!cbgwiki Magic (Opus) will return "[CBG Wiki] Magic (Opus) | "The most beautiful thing in this world is the mysterious. He to whom this emotion is a stranger is as good as dead; his eyes are closed ..." | http://www.thecbg.org/wiki/index.php?title=Magic_(Opus)"

Currently, disambiguation pages will show blanks, instead of what you'd see with the Wikipedia plugin. I'm still working on this part:

!cbgwiki Magic returns "[CBG Wiki] Magic | "Magic can refer to: ..." | http://www.thecbg.org/wiki/index.php?title=Magic"

Also, I haven't written anything to handle non-existent pages yet, so you'll likely see something like this if you try that:

!cbgw toaster returns "IndexError: list index out of range (file "/home/trevor/.sopel/modules/cbgwiki.py", line 24, in get_wiki_result)"


Cheers!

EDIT 1: Fixed an issue where un-capitalized queries for existing pages would return an error. Searches should be properly capitalized (and ideally pages on the Wiki are written in the same way). Still working on dealing with the no results issue.
[spoiler=GitHub]https://github.com/threexc[/spoiler]

Weave

Thanks for all the hard work, Yomega. I look forward to being able to use this in future IRC games.

Hibou

#2
Thanks Weave, especially for helping test!

So I've been making a few updates to the bot's functionality. I won't go into the gory details, but basically I didn't just use the standard MediaWiki-style search to pull results, and had to do a lot more error handling because of it. I've cleaned it up now, so things will look a bit different, but the commands are the same. Here are a few examples:

!cbgw opus
<AztecBot> [CBG Wiki] Opus | "The most beautiful thing in this world is the mysterious. He to whom this emotion is a stranger is as good as dead; his eyes are closed ..." | http://www.thecbg.org/wiki/index.php?search=opus&go=Go

!cbgw asura
<AztecBot> [CBG Wiki] Asura | "Main ..." | http://www.thecbg.org/wiki/index.php?search=asura&go=Go

!cbgw Progenitors
<AztecBot> [CBG Wiki] Search results | "You searched for Progenitors ..." | http://www.thecbg.org/wiki/index.php?search=Progenitors&go=Go



One thing that you might notice is that the Asura return (along with many others) is pretty vague. While this is fine and clicking the link will take you to the Asura main page, if you are personally interested in your wiki page having a more detailed return by the bot, I'd ask that you provide a simple summary of that page at the beginning before any headers, quotes, or anything else.

Cheers!
[spoiler=GitHub]https://github.com/threexc[/spoiler]