File tree 8 files changed +24
-28
lines changed
8 files changed +24
-28
lines changed Original file line number Diff line number Diff line change 9
9
10
10
< body >
11
11
< script src ="lib/echarts-5.4.2.min.js "> </ script >
12
- < script src ="lib/jquery-3.7.0.min.js "> </ script >
13
12
< select id ="sel-date-agg ">
14
13
< option value ="year "> Year</ option >
15
14
< option value ="quarter "> Quarter</ option >
37
36
< div id ="div-chart " style ="width: 100%;height:600px; "> </ div >
38
37
< div id ="div-chart-act-count " style ="width: 100%;height:600px; "> </ div >
39
38
< script >
40
- const session = "SessionIDPlaceholder " ;
39
+ const session = "SessionIdPlaceholder " ;
41
40
</ script >
42
41
< script src ="activityStats2.js "> </ script >
43
42
</ body >
Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ const promises = []; // array of promises for async fetching
22
22
//
23
23
// Data fetching
24
24
//
25
- function fetch_data ( session , date_agg ) {
25
+ const fetch_data = async ( session , date_agg ) => {
26
26
const url = `https://entorb.net/strava/download/${ session } /activityStats2_${ date_agg } .json` ;
27
- return $ . getJSON ( url )
28
- . done ( function ( data ) {
29
- console . log ( "done data download " + date_agg ) ;
30
- data_all [ date_agg ] = data ;
31
- } )
32
- . fail ( function ( ) {
33
- console . log ( " failed data download " + date_agg ) ;
34
- } ) ;
35
- }
27
+ try {
28
+ const response = await fetch ( url ) ;
29
+ const data = await response . json ( ) ;
30
+ console . log ( `done data download ${ date_agg } ` ) ;
31
+ data_all [ date_agg ] = data ;
32
+ } catch ( error ) {
33
+ console . log ( ` failed data download ${ date_agg } ` ) ;
34
+ }
35
+ } ;
36
36
37
37
// Start the async fetching
38
38
promises . push ( fetch_data ( session , "month" ) ) ;
Original file line number Diff line number Diff line change 69
69
my $cont = do { local $/ = undef ; <$fhIn > };
70
70
close $fhIn ;
71
71
$cont =~ s / ^.*<body>(.*)<\/ body>.*/ $1 / s ;
72
- $cont =~ s /SessionIDPlaceholder / $s {'session'}/ s ;
72
+ $cont =~ s /SessionIdPlaceholder / $s {'session'}/ s ;
73
73
say $cont ;
74
74
} # # end if ( $res->code() == 200)
75
75
else {
Original file line number Diff line number Diff line change 9
9
10
10
< body >
11
11
< div id ="table-activity-list "> </ div >
12
- < script src ="lib/jquery-3.7.0.min.js "> </ script >
13
12
< link href ="lib/tabulator.min.css " rel ="stylesheet ">
14
13
< script src ="lib/tabulator-5.4.min.js "> </ script >
15
14
< script src ="./activityTable.js "> </ script >
16
15
< script >
17
- const session = "SessionIDPlaceholder " ;
16
+ const session = "SessionIdPlaceholder " ;
18
17
</ script >
19
18
</ body >
20
19
Original file line number Diff line number Diff line change 1
1
/* eslint-disable camelcase */
2
2
/* eslint-disable require-jsdoc */
3
- ( "use strict" ) ;
3
+ "use strict" ;
4
4
5
5
// eslint-disable-next-line no-unused-vars
6
6
function defineTable ( ) {
@@ -260,15 +260,13 @@ function defineTable() {
260
260
261
261
const table = defineTable ( ) ;
262
262
263
- table . on ( "tableBuilt" , function ( ) {
264
- table . setData (
265
- "https://entorb.net/strava/./download/" + session + "/activityList.json"
266
- ) ;
263
+ table . on ( "tableBuilt" , ( ) => {
264
+ table . setData ( `https://entorb.net/strava/download/${ session } /activityList.json` ) ;
267
265
} ) ;
268
266
269
- table . on ( "cellClick" , function ( e , cell ) {
267
+ table . on ( "cellClick" , ( e , cell ) => {
270
268
const row = cell . getRow ( ) ;
271
269
const rowData = row . getData ( ) ;
272
- const activityUrl = rowData [ " x_url" ] ;
270
+ const activityUrl = rowData . x_url ;
273
271
window . open ( activityUrl ) ;
274
272
} ) ;
Original file line number Diff line number Diff line change 40
40
my $cont = do { local $/ = undef ; <$fhIn > };
41
41
close $fhIn ;
42
42
$cont =~ s / ^.*<body>(.*)<\/ body>.*/ $1 / s ;
43
- $cont =~ s /SessionIDPlaceholder / $s {'session'}/ s ;
43
+ $cont =~ s /SessionIdPlaceholder / $s {'session'}/ s ;
44
44
45
45
say $cont ;
46
46
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ mv tmp-dl/tabulator-$ver/dist/js/tabulator.min.js.map lib/tabulator.min.js.map
26
26
mv tmp-dl/tabulator-$ver /dist/css/tabulator.min.css lib/tabulator.min.css
27
27
mv tmp-dl/tabulator-$ver /dist/css/tabulator.min.css.map lib/tabulator.min.css.map
28
28
29
- # JQuery
30
- ver=3.7.0
31
- wget -q https://code.jquery.com/jquery-$ver .min.js -O lib/jquery-$ver .min.js
32
- wget -q https://code.jquery.com/jquery-$ver .min.map -O lib/jquery-$ver .min.map
29
+ # # JQuery
30
+ # ver=3.7.0
31
+ # wget -q https://code.jquery.com/jquery-$ver.min.js -O lib/jquery-$ver.min.js
32
+ # wget -q https://code.jquery.com/jquery-$ver.min.map -O lib/jquery-$ver.min.map
33
33
34
34
# Cleanup
35
35
rm -r tmp-dl
Original file line number Diff line number Diff line change 4
4
script_dir=$( cd $( dirname $0 ) && pwd)
5
5
cd $script_dir /..
6
6
7
- rm * .pl * .pm * .html gnuplot/*
7
+ # rm *.pl *.pm *.html gnuplot/*
8
8
rsync -rvhu --exclude=download
[email protected] :html/strava/ ./
You can’t perform that action at this time.
0 commit comments