Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Script cb2post.pl

by LanX (Saint)
on Apr 05, 2010 at 16:30 UTC ( [id://832851]=note: print w/replies, xml ) Need Help??


in reply to Devel::Declare vs LISP like macros...
in thread Is Devel::Declare really so much less evil than source filters?

for those interested here is the script I used to transform the CB-log saved from http://pthbb.org/cb/last.cgi into a readable post.

open $cb,"<","/tmp/cb.txt"; #- whole conversation into one string my $slurp=do {local $/,<$cb>};<P> #- split into single chats my @chatters=split /^\s*$/m, $slurp; for my $chat (reverse @chatters) { my (undef,$head,@text)=split /\n/m, $chat; #- print head my ($date,$time,$author)=split /\s+/,$head; print "<tt>", "[[$author]] $time", "</tt><br>\n"; #- /me text to italic if ($text[0]=~s/^\/me/[$author]/){ unshift @text,'<i>'; push @text,'</i>'; } #- named links for (@text){ s# (\w+) \( (http://.*?) \) #[$2|$1]#xg } #- print text print join "\n",@text; #- print separator print "\n<p>\n\n"; }

Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://832851]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 23:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found