diff --git a/.github/workflows/build_prod.yml b/.github/workflows/build_prod.yml index 9113fe2..f9bd7d0 100644 --- a/.github/workflows/build_prod.yml +++ b/.github/workflows/build_prod.yml @@ -32,10 +32,21 @@ jobs: key: ${{ secrets.KEY }} port: ${{ secrets.PORT }} source: "dist/*" - target: "domains/alix.guillard.fr/public_html/velo/velotraces/" + target: "domains/alix.guillard.fr/public_html/velo/traces/" strip_components: 1 rm: true + - name: Copy php recursively to remote + uses: appleboy/scp-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + source: "public/datavelo" + target: "domains/alix.guillard.fr/public_html/data/velo" + strip_components: 2 + - name: Configure SSH run: | mkdir -p ~/.ssh/ diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 7340408..0328c40 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -47,6 +47,17 @@ jobs: strip_components: 1 rm: true + - name: Copy php recursively to remote + uses: appleboy/scp-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + source: "public/datavelo" + target: "domains/alix.guillard.fr/public_html/data/velo" + strip_components: 2 + - name: Configure SSH run: | mkdir -p ~/.ssh/ diff --git a/index.html b/index.html index ce75a05..ef17d9d 100644 --- a/index.html +++ b/index.html @@ -10,5 +10,24 @@
+ + + + + diff --git a/public/datavelo/index.php b/public/datavelo/index.php new file mode 100644 index 0000000..9987178 --- /dev/null +++ b/public/datavelo/index.php @@ -0,0 +1,124 @@ + + + + + <F0><9F><9A><B2>tracks + + + + + + + + +"; +foreach ($tracks as $key => $val) { + $y = substr($val, 0, 4); + $countries = explode(".", $val); + $trackname = preg_replace('/[-_]/', ' ', substr($countries[0], 10)); + array_shift($countries); + array_pop($countries); + foreach($countries as $k => $v) { + if (!in_array($v, $known_countries)) { + // convert iso 3166 letter to flag + $lettred = mb_convert_encoding('&#' . (ord(substr($v, 0, 1)) + 127462 - 97) . ';', 'UTF-8', 'HTML-ENTITIES'); + $lettref = mb_convert_encoding('&#' . (ord(substr($v, 1, 2)) + 127462 - 97) . ';', 'UTF-8', 'HTML-ENTITIES'); + echo " $lettred$lettref"; + array_push($known_countries, $v); + } + if (!in_array($v.$y, $known_country_year)) { + array_push($known_country_year, $v.$y); + } + } +} +echo ""; +foreach($known_countries as $k => $v) { + echo ""; + foreach($known_country_year as $k2 => $v2) { + $v2y = substr($v2, 2,5); + if (substr($v2, 0,2) == $v) { + echo "$v2y
"; + } + + } + echo ""; +} +echo ""; + +echo ""; +$i = 0; +foreach ($tracks as $key => $val) { + $date = substr($val, 0, 10); + if ($date != "2010-01-01") { + $i++; + $countries = explode(".", $val); + $trackname = preg_replace('/[-_]/', ' ', substr($countries[0], 10)); + array_shift($countries); + array_pop($countries); + echo ""; + echo ""; + } +} +echo "
"; + echo $date; + echo ""; + echo $i."" .$trackname. ""; + foreach($countries as $k => $v) + { + // convert iso 3166 letter to flag + $lettred = mb_convert_encoding('&#' . (ord(substr($v, 0, 1)) + 127462 - 97) . ';', 'UTF-8', 'HTML-ENTITIES'); + $lettref = mb_convert_encoding('&#' . (ord(substr($v, 1, 2)) + 127462 - 97) . ';', 'UTF-8', 'HTML-ENTITIES'); + echo("$lettred$lettref "); + } + echo "
"; +?> + + + + + + diff --git a/public/datavelo/tracklist.json.php b/public/datavelo/tracklist.json.php new file mode 100644 index 0000000..6ec7ef5 --- /dev/null +++ b/public/datavelo/tracklist.json.php @@ -0,0 +1,53 @@ + $val) { + $date = substr($val, 0, 10); + if ($date != "2010-01-01") { + $i++; + $countries = explode(".", $val); + $name = preg_replace("/[-_]/", " ", substr($countries[0], 10)); + array_shift($countries); + array_pop($countries); + $cc = implode(" ", $countries); + $flag = ""; + foreach($countries as $k => $v) + { + // convert iso 3166 letter to flag + $lettred = mb_convert_encoding('&#' . (ord(substr($v, 0, 1)) + 127462 - 97) . ';', 'UTF-8', 'HTML-ENTITIES'); + $lettref = mb_convert_encoding('&#' . (ord(substr($v, 1, 2)) + 127462 - 97) . ';', 'UTF-8', 'HTML-ENTITIES'); + $flag = $flag."".$lettred.$lettref; + } + $trackobject = (object) ['id' => $i, 'date' => $date, 'name' => $name, 'url' => $val, 'cc' => $cc, 'flag' => $flag]; + array_push($trackliste, $trackobject); + } +} +echo json_encode($trackliste); +?> diff --git a/public/datavelo/tracks.php b/public/datavelo/tracks.php new file mode 100644 index 0000000..888bada --- /dev/null +++ b/public/datavelo/tracks.php @@ -0,0 +1,34 @@ + \ No newline at end of file