What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » perl to tcl?

perl to tcl?
Author: Message:
rix
Full Member
***

Avatar

Posts: 483
Reputation: 16
34 / Male / Flag
Joined: Apr 2004
O.P. perl to tcl?
Hey guys,

i have one Irssi script, based on C, but my bot uses TCL. Is it possible to convert script from C to TCL?

code:
#!/usr/bin/perl
my $ch = shift;
my $n2ita = 0;
if ($ch eq "etv") {
    $ch = 1;
    $kanal =  "ETV";
    }
    elsif ($ch eq "kanal2")
    {
    $ch = 2;
    $kanal = "Kanal 2";
    }
    elsif ($ch eq "tv3")
    {
    $ch = 3;
    $kanal = "TV 3";
    }
    else
    {
    print " Tundmatu kanal. Valikud on etv, kanal2, tv3\n";
    exit 0;
}
my $url = "http://www.w3.ee/index.php?id=54";
my @page = `lynx -display_charset=UTF-8 -crawl -width=20000 -source $url | grep -A 6 header`;

foreach(@page) {
    next if(/^\s*$/);
        $n2ita = 1 if(/$ch/);
    s/^\s*//;
    s/<tr>/\n/g;
    s/<\/tr>/\n/g;
#    s/<[^>]*>/;/g;
#    s/<.b>/;/g;
#    s/<.td>/;/g;
#    s/\s\s*/ /g;
    s/ä/ä/g;
    s/ü/ü/g;
    s/Ã\//Ü/g;
    s/õ/õ/g;
    s/ÃU/Õ/g;
    s/ö/ö/g;
    s/ž/¸/g;
    s/â/"/g;
    s/&otilde;/õ/g;
    s/<[^>]*>/;/g;
    s/Ã/Ü/g;
#    s/^(.{389}).*$/\1.../;
#    s/--//g;
        push(@kava,$_);
}
$a = join(" ", @kava);
$a = substr($a, 4, -13);
@saade = split(/;/, "$a");
#print @kava;
if ($ch eq "1") {
    print "Kanal: [" . $kanal ."] Saade: [" . @saade[35] . "] Algas: [" . @saade[32] . "] Kirjeldus: [" . @saade[37] . "] Aeg: [" .  @saade[38] . "]\n";
        }
        elsif ($ch eq "2")
    {   
    print "Kanal: [" . $kanal ."] Saade: [" . @saade[49] . "] Algas: [" . @saade[46] . "] Kirjeldus: [" . @saade[51] . "] Aeg: [" .  @saade[52] . "]\n";
    }
    elsif ($ch eq "3")
    {
    print "Kanal: [" . $kanal ."] Saade: [" . @saade[63] . "] Algas: [" . @saade[60] . "] Kirjeldus: [" . @saade[65] . "] Aeg: [" .  @saade[66] . "]\n";
    }
#print @kava;


Or is there so kind people, who could write it into tcl? :) It takes on-air tv shows information from w3.ee site and privmsg it to user.

This post was edited on 09-18-2005 at 08:42 AM by rix.
Show Plus! your commitment - Support Plus!
:: Plus!'s Estonian community - http://foorum.msgpluslive.ee/ ::
09-17-2005 09:10 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
perl to tcl? - by rix on 09-17-2005 at 09:10 AM
RE: C to tcl? - by segosa on 09-17-2005 at 05:23 PM
RE: perl to tcl? - by rix on 09-18-2005 at 08:44 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On