Introduction About Site Map

RSS 2 Feed RSS 2 Feed

Main Page | Blog Index

Monday, January 23rd, 2012, 2:25 pm

How to Quickly Produce HTML-Formatted IRC Logs


ON a daily basis I must produce logs for 4 IRC channels. Over time I found more efficient ways for doing so and this post summarises some of the shortcuts and tools. It doesn’t go into specifics where these are not generalisable.

The first stage is opening a template for the post/article linking to the log/s. The post has X’s where the data goes, so that part must be completed by hand and then copied and pasted into the right fields. The way this is done depends on the site and its layout, but the important thing is, use templates. If this gets done daily, then a lot of work and many errors can be prevented.

Then comes the point where the logs themselves get produced. Logging is typically done by IRC clients, but only XChat works well for me with the script that I use since 2008, irclog2html. The first thing to do is open all the files containing the relevant logs. In my case it goes like this:

roy@roy:~$ cat ./ 
kate .xchat2/xchatlogs/FreeNode-#boycottnovell.log  

The directory and relative paths may vary and one’s favourite text editor may vary as well (I like Kate). Once all the files are open (about 200 MB in my case), open all the previous logs (if any) and scroll down to the bottom. Then, copy a portion of the last line and search for it in the full log to quickly jump to the latest log line, then extend the selection (highlight with keyboard/mouse) to grab the new log text to be converted into HTML. Once this is done, open a new tab/windows, paste the text, and save the text as a file whose name is corresponding to the channel at hand. In my case, that would be irc-log-social, irc-log-techbytes, irc-log-techrights, and irc-log.

Once all the text to be converted is put in the correctly and consistently named files, batch-run the conversion and open the resultant files in a text editor. For example:

python ./Main/Programs/ irc-log-techrights 
--title='IRC: #techrights @ FreeNode: January 22nd, 2012' ; 
python ./Main/Programs/ irc-log --title='IRC:  
#boycottnovell @ FreeNode: January 22nd, 2012' ; python 
./Main/Programs/ irc-log-social --title='IRC:  
#boycottnovell-social @ FreeNode: January 22nd, 2012' ; python 
./Main/Programs/ irc-log-techbytes --title='IRC: 
#techbytes @ FreeNode: January 22nd, 2012' ; kate irc-log.html 
irc-log-social.html irc-log-techrights.html irc-log-techbytes.html

This is basically a simple command run about 4 times, then 4 files opened. Python is needed to run and there is room for some parameters like page titles. The opening of the resultant files then makes it possible to save under date-stamped files all the logs separately, then upload them and link to them in the template post. That’s about it. If there are any questions about these very basic efficiency tricks, drop me a line. Having published thousands of logs, it is an area I’m quite familiar with.

Technical Notes About Comments

Comments may include corrections, additions, citations, expressions of consent or even disagreements. They should preferably remain on topic.

Moderation: All genuine comments will be added. If your comment does not appear immediately (a rarity), it awaits moderation as it contained a sensitive word or a URI.

Trackbacks: The URI to TrackBack this entry is:

Syndication: RSS feed for comments on this post RSS 2

    See also: What are feeds?, Local Feeds

Comments format: Line and paragraph breaks are automatic, E-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Back to top

Retrieval statistics: 21 queries taking a total of 0.117 seconds • Please report low bandwidth using the feedback form
Original styles created by Ian Main (all acknowledgements) • PHP scripts and styles later modified by Roy Schestowitz • Help yourself to a GPL'd copy
|— Proudly powered by W o r d P r e s s — based on a heavily-hacked version 1.2.1 (Mingus) installation —|