--- clipinc_mark.pl.sik 2006-05-01 07:54:16.000000000 +0200
+++ clipinc_mark.pl 2006-05-01 13:01:56.000000000 +0200
@@ -239,6 +239,18 @@
agent => "Tobit ClipInc"
);
+ #print "Request:\n";
+ #print "http://" . $CLIPINC_HOST . "/getStreamTags.asp".
+ #"?ChannelID=" . $channelid.
+ #"&LastDate=" . $lastdate.
+ #"&Version=" . $CLIPINC_VERSION.
+## "&Channel=" . ,.
+ #"&Site-ID=" . $LICENSE.
+ #"&Time-Ref=" . TimeUnixToClipInc()
+## "&Time-Ref=25.03.2004 23:35:00.00"
+ #;
+ #print "\n";
+
my $response = $ua->get(
"http://" . $CLIPINC_HOST . "/getStreamTags.asp".
"?ChannelID=" . $channelid.
@@ -255,55 +267,67 @@
return;
}
- # Split lines at
and parse return data
+ # Split lines at line feed and parse return data
my($st_count,$st_vintern,$st_timeref,$st_offset);
my @streamtags;
- my @lines = split(/
/, $response->content);
-#print ">> ", $response->content, " <<\n";
- if(scalar(@lines) == 0) {
- print "$NAME: Server reply is empty",
- $LICENSE eq 'xxxxx-xxxxx'
- ? " - please set \$LICENSE and read the README!\n"
- : " - invalid license?\n";
- return;
- }
-
- foreach(@lines) {
- if($_ =~ /^count=(\d*)/) {
- $st_count = $1;
- } elsif($_ =~ /^vintern=(\d*)/) {
- $st_vintern = $1;
- } elsif($_ =~ /^time-ref=(.*)/) {
- $st_timeref = $1;
- } elsif($_ =~ /^offset=(.*)/) {
- $st_offset = $1;
- } else {
- $_ =~ /(.*?)\s(.*?\s.*?)\s(.*?\s.*?)\s"(.*?)"\s(\d+)\s(\d+)\s"(.*?)"\s"(.*?)"\s"(.*?)"/;
- my %streamtag = (
- StationID => $1,
- StartDate => $2,
- EndDate => $3,
- Title => $4,
- Genre => $5,
- Whatever1 => $6,
- Interpret => $7,
- Album => $8,
- Web => $9
- );
-
- if(TimeClipIncToUnix($streamtag{EndDate}) < $newestdate) {
- push @streamtags, \%streamtag;
+ #print "Response:\n";
+ #print ">> ", $response->content, " <<\n";
+ my @linex = split(/\n/, $response->content);
+
+ #print "Response lines (lf):\n";
+ #foreach(@linex) { print $_ . "Zeilenende\n"; }
+ # my @lines = split(/
/, $response->content);
+ foreach(@linex) {
+ if($_ =~ /count=(\d*)/) {
+ # Split lines at
and parse return data
+ my @lines = split(/
/, $_);
+ #print "Content lines:\n";
+ #foreach(@lines) { print "$_\n"; }
+ if(scalar(@linex) == 0) {
+ print "$NAME: Server reply is empty",
+ $LICENSE eq 'xxxxx-xxxxx'
+ ? " - please set \$LICENSE and read the README!\n"
+ : " - invalid license?\n";
+ return;
+ }
+ foreach(@lines) {
+ if($_ =~ /^count=(\d*)/) {
+ $st_count = $1;
+ } elsif($_ =~ /^vintern=(\d*)/) {
+ $st_vintern = $1;
+ } elsif($_ =~ /^time-ref=(.*)/) {
+ $st_timeref = $1;
+ } elsif($_ =~ /^offset=(.*)/) {
+ $st_offset = $1;
+ } else {
+ $_ =~ /(.*?)\s(.*?\s.*?)\s(.*?\s.*?)\s"(.*?)"\s(\d+)\s(\d+)\s"(.*?)"\s"(.*?)"\s"(.*?)"/;
+ my %streamtag = (
+ StationID => $1,
+ StartDate => $2,
+ EndDate => $3,
+ Title => $4,
+ Genre => $5,
+ Whatever1 => $6,
+ Interpret => $7,
+ Album => $8,
+ Web => $9
+ );
+
+ if(TimeClipIncToUnix($streamtag{EndDate}) < $newestdate) {
+ push @streamtags, \%streamtag;
+ }
}
}
+
+ print "Information about stream tags:\n";
+ print "Count: $st_count (".scalar(@streamtags)." after filtering)\n";
+ print "VIntern: $st_vintern\n";
+ print "Time-Ref: $st_timeref\n";
+ print "Offset: $st_offset\n\n";
+
+ return $st_offset, @streamtags;
+ }
}
-
- print "Information about stream tags:\n";
- print "Count: $st_count (".scalar(@streamtags)." after filtering)\n";
- print "VIntern: $st_vintern\n";
- print "Time-Ref: $st_timeref\n";
- print "Offset: $st_offset\n\n";
-
- return $st_offset, @streamtags;
}
sub ExtractStreams