-
Notifications
You must be signed in to change notification settings - Fork 4
/
activityTop10V2.pl
executable file
·47 lines (35 loc) · 1.12 KB
/
activityTop10V2.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl -w
# by Torben Menke https://entorb.net
# DESCRIPTION
# displays tabulator table of cached activities
# TODO
# DONE
# * use html as template
# * use tabulator JS lib
# Modules: My Default Set
use strict;
use warnings;
use 5.010; # say
use Data::Dumper;
use utf8; # this script is written in UTF-8
binmode STDOUT, ':utf8'; # default encoding for linux print STDOUT
# Modules: Web
use CGI;
my $cgi = CGI->new;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
# Modules: My Strava Module Lib
use lib ('.');
use TMsStrava qw( %o %s)
; # at entorb.net some modules require use local::lib!!!
TMsStrava::htmlPrintHeader( $cgi, 'Activity Top10 V2' );
TMsStrava::initSessionVariables( $cgi->param("session") );
TMsStrava::htmlPrintNavigation();
my $fileIn = "activityTop10V2.html";
open my $fhIn, '<:encoding(UTF-8)', $fileIn
or die "ERROR: Can't read from file '$fileIn': $!";
my $cont = do { local $/ = undef; <$fhIn> };
close $fhIn;
$cont =~ s/^.*<body>(.*)<\/body>.*/$1/s;
$cont =~ s/SessionIdPlaceholder/$s{'session'}/s;
say $cont;
TMsStrava::htmlPrintFooter($cgi);