From 630af0ed6c0af69c7df2e45aef7a87722a3c00c0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:47 +0200 Subject: tagging ychat-perl-legacy --- 0.4.5a/push.pl | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 0.4.5a/push.pl (limited to '0.4.5a/push.pl') diff --git a/0.4.5a/push.pl b/0.4.5a/push.pl new file mode 100644 index 0000000..0157665 --- /dev/null +++ b/0.4.5a/push.pl @@ -0,0 +1,103 @@ +#!/usr/bin/perl -w + +# yChat - Copyright by Paul C. Bütow + +use CGI; +CGI->compile(':all'); +$q = new CGI; +print + $q->header; +require config; + +$alias = $q->param("alias"); +$tmpid = $q->param("tmpid"); +&secure_checkid($alias); +$room = $q->param("room"); + +######################################## +##ANFANG DER ZU STREAMENDEN HTML-DATEI## +######################################## + +print < + + + + +END + +############################# +##BEGRÜSSUNGSTEXT SCHREIBEN## +############################# + +my $msgfile; + +print + $q->font( { -size=>1, + -color=>"ffffff", + -face=>"arial"}, + "$title - Created & Copyright by Paul C. Bütow [PID: $$]
\n"); + +if (-f "data/user/memos/$alias") { + open(MEMOS,"; + close MEMOS; + print $memos; + unlink("data/user/memos/$alias"); +} + +############################### +##ENDLOSSCHLEIFE FÜR DEN PUSH## +############################### + +my $counter = 0; +my $startime; +OPENMSGFILE: +$startime = time; + +if (-e "data/online/users/$alias") { + open(MSGFILE,"; $curpos = tell(MSGFILE)) { + my ($address, $stamp, $command, $action, $message) = split(/<;/, $_); + if ($address eq "!" || $address eq $alias) { + if ($stamp > $startime) { + if ($command eq "cr") { + $room = $action; + close MSGFILE; + goto OPENMSGFILE; + } + print "$message
\n"; + } + } + } + $counter++; + if ($counter > 14) { + print "\n"; + $counter = 0; + } + sleep 1; + seek(MSGFILE, $curpos, 0); +} \ No newline at end of file -- cgit v1.2.3