Kirsle.net logo Kirsle.net

Tagged as: Perl

Text-Based CyanChat Client
October 24, 2008 by Noah
I was looking at my CPAN directory the other day and noticed that my CyanChat modules were poorly documented, to the point where if I was somebody else and didn't know about Kirsle's Perl CyanChat Client, I'd have no example code to reference to figure out how to use these modules.

So, I've decided to update the modules and add some better examples in its documentation. I also thought it would be nice to include a demonstration program for a CyanChat client. The distribution already comes with a sample server script, but none for a client. I didn't wanna include a bot though, because then CyanChat would have these bots entering the room from people testing the demo script, and nobody likes bots. And then, PCCC is a heavy program to include as an example script. So, I decided to make a new CyanChat client that would be light enough to work.

So, I've created a text-based CyanChat client:
Terminal CyanChat Client

The script is mostly standalone: just one Perl script that uses Net::CyanChat. And also Term::ReadKey, which is easy to install. It doesn't use Curses or any other terminal GUI toolkit: it's all plain old text and ANSI colors. I built in my own kind of buffer system, and any time the chat dialog (or typed message prompt) changes, the window is cleared and redrawn from top to bottom, keeping track of how many characters and lines are being written so that it cuts off the buffer directly at the bottom of your terminal. And it works no matter what your terminal's dimensions are.

More screenshots:

Intro
The main menu screen, changing the CC host back to using port 1812 (I used 1813 as the default port number for development purposes).

Chatting
The CyanChat client in full operation.

Update: It works on Windows too (to much amazement as the command prompt completely sucks):

Win32 Console

Tags: 2 comments | Permalink
Favicon Generator
October 15, 2008 by Noah
Dynamic Drive has one, and now I do too: a Favicon Generator. It's a lil CGI application that takes an uploaded image and converts it into a Win32 icon file, specifically the 16x16 resolution variety that are used as favorites icons for websites.

Dynamic Drive's was cool and I've been using it thus far to generate all my favicon files (and some regular icons for use in some of my software like PCCC and ErrorGen), but my generator 1up's that by also being able to include 96x96 resolution icons (Windows Vista size).

To those curious, I mainly used the Perl modules GD and Imager to manipulate the uploaded image and save it as a Win32 icon. I won't give out the code behind my favicon.cgi though because it's really not that hard to figure out just from the manpages of the Imager module (see Imager::File::ICO).

Tags: 0 comments | Permalink
Tk::StyleDialog
September 18, 2008 by Noah
Since there was enough interest in my two-year-old program, ErrorGen, I've created a Perl/Tk module that does basically what ErrorGen does.

Here's a screenshot:
Synopsis

It's only a module so far that can be included in other Perl/Tk applications. But it's one very large step closer to me creating a simplified tool to spawn error boxes which could be provoked from batch files or scripts. It will probably have a syntax similar to the GNOME program, Zenity.

CPAN takes a few hours to index module updates but the new module will be available at Tk::StyleDialog on CPAN.org.

UPDATE: I've thrown together a quick program called ZenMsg (a name derived from GNOME's Zenity, but since my program only does dialog boxes, it's called ZenMsg).

I've added it as a new tab to the ErrorGen page. Let me know if it can be improved. I had to use ActiveState PerlApp to compile it because PAR::Packer (which I usually prefer to use) was giving me trouble and I didn't have the time or motivation to setup a clean new compiling environment for it. PerlApp may be a bit too limiting.

Tags: 0 comments | Permalink
Tk::HyperText Uploaded
July 14, 2008 by Noah
Finally, I've shipped Tk::HyperText version 0.06 on its way to CPAN's network. It won't be up immediately but in the next few hours the following link will go to the page for version 0.06:

Tk::HyperText.

Here's a screenshot of the demo program that comes with it:

Tk-HyperText

Tags: 0 comments | Permalink
Forum Spambots
July 8, 2008 by Noah
There's a retarded new breed of forum spam bot crawling the web lately. Unlike the spam bots that try to stuff posts full of links to virus-ridden websites, these bots just seem to register and say things like "Nice site! Where'd you get it?"

The RiveScript.com YaBB forum has gotten at least two of these low-hanging spam bots recently. I modified the YaBB source to try and stop these things from being able to register by employing some of the same techniques that keep Cuvou.com safe from "dumb submitter bots" and we'll see if that helps...

Remind me to write a big long article about spam bots and how to fight them. I have some pretty good techniques that seem to work quite effectively but I currently don't have the motivation to write about them at this point in time.

Update: I've written an article about stopping dumb submitter bots: Trapping "Dumb Submitter Bots".

Tags: 0 comments | Permalink
libcuvou
May 11, 2008 by Noah
If anyone cares, I released my Cuvou::Traffic module for download. The module is released under the I don't give a damn license, if you find it useful then good, but YMMV.

It's on the libcuvou page.

Tags: 1 comment | Permalink
Tk::HyperText Rewrite
May 8, 2008 by Noah
Today I've begun reprogramming my Tk::HyperText widget. The old module didn't use any "real" HTML parsers, so it was reading the HTML code in as plain text and trying to figure out how to display it that way. The new module is going to use HTML::TokeParser, which will make the code cleaner and also more efficient and less buggy.

I've only been working on it for a couple of hours so far, and all it supports so far is the font tag, bold, italic, underline, and line breaks. Here's a screenshot:

Tk-HyperText Beta

The functionality of the module when it's done is going to be drastically different to what's currently on CPAN. I don't know if anyone has actually used Tk::HyperText in their programs yet, but the new module will definitely break programs that were relying on the methods provided by the old module. I'm thinking I'll have the module use similar methods and handlers to Wx::ActiveX::Mozilla.

Update (4:54 PM EDT) - The module now supports pretty much all the markup tags (not links, lists, or obscure tags like abbr and acronym though). Something else of interest is that only the first body tag found will recolorize the widget as a whole; any additional body tags will only override the colors of the current text style, so you can get the "AIM effect" with it (where each message can have its own background color which covers its entire horizontal space).

Body BG Colors

I'll probably have the new module on CPAN within a few days.

Update (5/9) - It supports tables now!

Tables!

Tags: 0 comments | Permalink