#!perl -w # For users of framechat and active desktop, and other purposes. # Creates seven html files in script dir representing framechat's # frames. Run from shell or CGI and supply just the url at # command line or url=http://localhost/framechat.pl from CGI. use strict; use CGI ':standard'; use CGI::Carp 'fatalsToBrowser'; my$url = url(); my($uri,%i); if(@ARGV){ $uri = shift } else{ unless($ENV{'HTTP_ACCEPT'}){ print "\nPlease supply command line arg:\n\n perl this_script.pl http://localhost/framechat.pl\n"; exit }} BEGIN{ if($ENV{'HTTP_ACCEPT'}){ my%i = map{$_ => param($_)} param}} if($i{'url'}){ if($i{'url'}=~m|^https?://|){$uri = $i{'url'}}} if(($ENV{'HTTP_ACCEPT'}) && (!$i{'url'})){ print header(),start_html(title=>"framechat desktop setup"),p("Please append your framechat url to the url of this script: $url?url=http://localhost/framechat.pl"); exit} my%items = ( inbox => "$uri?n=inbox", chat => "$uri?n=chat", talk => "$uri?n=talk", xp => "$uri?n=xp", users => "$uri?n=users", ctrl => "$uri?n=ctrl", framechat => "$uri", ); print "Content-type: text/html\n\n
" if $ENV{'HTTP_ACCEPT'};
print "\nFramechat URL = $uri\n\n";
for(keys %items){
	open(FILE,"> $_.html") or die "Need write permission in the current directory: $!";
	print FILE qq~Load $_~;
	close(FILE) or die "$!";
	if($ENV{'HTTP_ACCEPT'}){
		print qq~Created $_.html\n~;
		}
	else{ print qq~Created $_.html\n~;
	}
}
print "\nDone!\n\n Now you can embed pieces of framechat\n in active desktop by loading these html\n pages. Framechat URL should be set to\n the URL of your local copy of framechat,\n while your webserver is running.\n";