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
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: C to tcl?
That's perl.

I'd convert it, but I don't know TCL.
The previous sentence is false. The following sentence is true.
09-17-2005 05:23 PM
Profile PM Find Quote Report
rix
Full Member
***

Avatar

Posts: 483
Reputation: 16
34 / Male / Flag
Joined: Apr 2004
O.P. RE: perl to tcl?
That's sad. But script author said it's in C. I don't know anything about it...actually he mentioned perl.

Is there anybody who knows both perl & tcl?
Show Plus! your commitment - Support Plus!
:: Plus!'s Estonian community - http://foorum.msgpluslive.ee/ ::
09-18-2005 08:44 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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