forked from entorb/strava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivityTable.pl
87 lines (69 loc) · 2.61 KB
/
activityTable.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/perl -w
# by Torben Menke https://entorb.net
# DESCRIPTION
# display statistics for cached activities
# TODO
# For the yearly averages 0 values need to be used to fill the gaps
# this is wrong for pace and other averages!!!
# For the av_all this is wrong!!!
# IDEAS
# * mark record per date bold
# * add record activity value
# DONE
# * add quarter
# 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: Perl Standard
use Encode qw(encode decode);
# use File::Path qw/remove_tree/;
use Time::Local;
use Storable; # read and write variables to
use File::Basename; # for basename, dirname, fileparse
use File::Copy;
use Cwd; # for my $dir = getcwd;
# Modules: Web
use CGI;
my $cgi = CGI->new;
#use CGI ":all";
#use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
# Modules: My Strava Module Lib
use lib ( '.' );
use lib ( '/var/www/virtual/entorb/perl5/lib/perl5' );
use lib "C:\\Users\\menketrb\\Documents\\Hacken\\Perl\\Strava-Web"; # just for making Visual Studio Code happy
use lib "d:\\files\\Hacken\\Perl\\Strava-Web";
use TMsStrava qw( %o %s); # at entorb.net some modules require use local::lib!!!
TMsStrava::htmlPrintHeader( $cgi, 'Activity table' );
TMsStrava::initSessionVariables( $cgi->param( "session" ) );
TMsStrava::htmlPrintNavigation();
print '
<script src="./activity-tabulator.js"></script>
<script src="/COVID-19-coronavirus/js/jquery-3.5.0.min.js"></script>
<!-- Polyfiles for IE, suggested by Tabulator : http://tabulator.info/docs/4.6/browsers#ie -->
<script src="/COVID-19-coronavirus/js/tabulator-polyfill.min.js"></script>
<script src="/COVID-19-coronavirus/js/tabulator-fetch.umd.js"></script>
<!-- Tabulator -->
<link href="/COVID-19-coronavirus/js/tabulator.min.css" rel="stylesheet">
<script src="/COVID-19-coronavirus/js/tabulator-4.6.min.js"></script>
<div id="table-activity-list"></div>
<!--
Start JavaScript
-->
<script>
// variables
const promises = []; // array of promises for async fetching
// ASync JQuery fetching
function fetch_table_data() {
table.setData("https://entorb.net/strava/' . $s{ 'pathToActivityListJsonDump' } . '", {}, "get")
}
// define and populate table
var table = defineTable();
promises.push(fetch_table_data());
</script>
';
TMsStrava::htmlPrintFooter( $cgi );