mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
71fe020f84
git-svn-id: https://svn.fhem.de/fhem/trunk@3 2b470e98-0d58-463d-a4d8-8e2adae1ed80
38 lines
692 B
Perl
Executable File
38 lines
692 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
use CGI;
|
|
use IO::Socket::INET;
|
|
use warnings;
|
|
|
|
|
|
$host="localhost:7072";
|
|
|
|
sub
|
|
getXmlList() {
|
|
my $server = IO::Socket::INET->new(PeerAddr => $host);
|
|
my $str = "";
|
|
|
|
if ($server) {
|
|
my $buf;
|
|
|
|
syswrite($server, "xmllist; quit\n");
|
|
while(sysread($server, $buf, 256) > 0) {
|
|
$str .= $buf
|
|
}
|
|
} else {
|
|
$str="<ERROR msg='Cannot connect to the server'/>\n";
|
|
}
|
|
return $str;
|
|
}
|
|
|
|
my $cgi = new CGI;
|
|
print $cgi->header( "-type" => "text/xml; charset=UTF-8",
|
|
"-Expires" => "0",
|
|
"-Cache-Control" => "no-chache",
|
|
"-Pragma" => "no-cache"
|
|
);
|
|
|
|
print "<?xml version='1.0'?>\n";
|
|
print getXmlList();
|
|
|