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.2.2/push.pl | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 0.2.2/push.pl (limited to '0.2.2/push.pl') diff --git a/0.2.2/push.pl b/0.2.2/push.pl new file mode 100644 index 0000000..5489592 --- /dev/null +++ b/0.2.2/push.pl @@ -0,0 +1,85 @@ +#!/usr/bin/perl -w +use CGI; +$q = new CGI; + +print + $q->header; # HTML-Header erzeugen + +require config; + +&secure_checkip($alias); + +######################################## +##ANFANG DER ZU STREAMENDEN HTML-DATEI## +######################################## + +print < + + + + +END + +$| = 1; # Cache von Perl ausschalten + +############################# +##BEGRÜSSUNGSTEXT SCHREIBEN## +############################# + +my $msgfile; + + print + $q->font( { -size=>1, + -color=>"ffffff", + -face=>"arial"}, + "$title Copyright by Paul C. Bütow 2k $tmp\n"); + +if ($var eq "push_logs_html") { + $msgfile = $tmp; + print "
"; +} elsif ($var eq "clear_screen") { + $msgfile = "data/msgs/$alias"; + &write_file_new($msgfile); + print DATEI $q->br; + close DATEI; +} else { + $msgfile = "data/msgs/$alias"; + print $q->br; +} + +open (MSGFILE, $msgfile); + +################################# +##ENDLOSSCHLEIFE FÜR DEN STREAM## +################################# + +my ($times,$online) = (0,"false"); +for (;;) { + for ($curpos = tell(MSGFILE); ; $curpos = tell(MSGFILE)) { + print $_ ; + } + $times++; + if ($times > 29) { # Nach 30 Sekunden + print "\n"; # Ping zum Browser senden + $times = 0; # Sekundenzahl auf 0 zurücksetzen + $online = "true" if (-e "data/online/users/$alias"); + if ($online eq "false") { + print "Aus technischen Gründen bitte auf Weiterchatten klicken."; + exit; + } + } + sleep 1; + seek(MSGFILE, $curpos, 0); # Position wiederherstellen +} -- cgit v1.2.3