#!/usr/bin/perl -w ## The script is placed in twiki/tools dir BEGIN { unshift @INC, '.'; require '../bin/setlib.cfg'; } my $web = $ARGV[0] || die "Error: Web miss.(./findnontopics.pl WEB)"; use Socket; use TWiki; my $twiki = new TWiki(); my $store = $twiki->{store}; my @topics= $store->getTopicNames( $web ); my $twurl =$TWiki::cfg{ScriptUrlPath}; my $adim="SuperAdmin"; my $admpwd="passadmin"; my $logheader="username=$adim&password=$admpwd&origurl="; my $twid; my %counter; my %out; my $html; my $url; my $host = "127.0.0.1"; my $port = "80"; my $header = "Host: $host"; ##log in $url = "GET $twurl/login/TWiki/WebHome?origurl="; $twid = &getUrl($host,$port,$url,$header); $twid=~/Set-Cookie: (TWIKISID=\w+)/; $url ="POST $twurl/login/TWiki/WebHome"; $header ="Host: $host\r\nCookie: $1\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: ".length($logheader)."\r\n\r\n$logheader"; $twid = &getUrl($host,$port,$url,$header); ## loged sesssion $header ="Host: $host\r\nCookie: $1"; ##Colect data foreach my $topic ( $store->getTopicNames( $web )) { $url = "GET $twurl/view/$web/$topic"; next if $topic =~/^NonTopicsReport$|^Trash|^WebAtom$|^WebRss$|^WebPreferences$|^WebStatistics$/; $html = &getUrl($host,$port,$url,$header); while ($html=~/([^<]*) ) { $result .= $_; } close( SOCK ) or die "close: $!"; select STDOUT; return $result; } ##Report my $DATE = `date +\%Y-\%m-\%d\\ \%H:\%M`; print <