#!/usr/local/gnu/bin/perl # tam-tam: send a message to a "tam-tam" pocket receiver. # # Written by Ch. Tronche (http://www-ihm.lri.fr/~tronche/) # Copyright by the author. This is unmaintained, no-warranty free software. # Please use freely. It is appreciated (but not mandatory) to acknowledge # the author's contribution. Thank you. # Started on Thu Oct 10 15:07:37 1996 # # Idea: Michel Beaudouin-Lafon (http://www-ihm.lri.fr/~mbl/) # $calepin = $ENV{HOME}.'/.tamtam-calepin'; if (!@ARGV || $#ARGV > 1 || $ARGV[0] eq '-help') { die <); } if ($abonne !~ /^\d+$/o) { open(CALEPIN, "<$calepin") || die "I can't open your tam-tam directory file '$calepin'"; while() { chop; ($name, $number) = split /\t+/o; if ($name eq $abonne) { $abonne = $number; last; } } die "I haven't found $name in your tam-tam directory file '$calepin'" unless $abonne =~ /^\d+$/o; } $sender = `whoami`; chop $sender; $message .= " -- $sender"; $message =~ s/([^a-zA-Z0-9])/sprintf "%%%02X", ord($1)/geo; $message =~ s/%20/+/go; $message = "abonne=$abonne&message=$message&flagRepete=0&horloge=%3B"; $length = length $message; warn "Length > 160, you may experience some troubles" if $length > 160; open(COMMAND, "|telnet www.tamtam.tm.fr 80 >/dev/null") || die "I can't contact the tam-tam server"; #open(COMMAND, "|cat") || die "I can't contact the tam-tam server"; print COMMAND <