1 Commits
master ... html

Author SHA1 Message Date
055e1b4ebf Output data to CSV and convert to HTML 2019-09-29 03:26:26 -04:00
8 changed files with 1205 additions and 2 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
*.csv
*.html
*.txt *.txt
api-keys-fish.sh api-keys-fish.sh

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "csi.js"]
path = csi.js
url = https://github.com/LexmarkWeb/csi.js

1
csi.js Submodule

Submodule csi.js added at 2d99a233a5

14
csv-to-html.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
echo "<table>" ;
print_header=true
while read INPUT ; do
if $print_header;then
# echo "<tr><th>$INPUT" | sed -e 's/:[^,]*\(,\|$\)/<\/th><th>/g'
echo "<tr><th>${INPUT//,/</th><th>}</th></tr>" ;
print_header=false
else
echo "<tr><td>${INPUT//,/</td><td>}</td></tr>" ;
fi
done < dark-sky.csv ;
echo "</table>"

View File

@@ -3,4 +3,5 @@ source api-keys-fish.sh
set curl_url "https://api.darksky.net/forecast/$DARK_SKY_KEY/43.8180904,-79.3350555?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto" set curl_url "https://api.darksky.net/forecast/$DARK_SKY_KEY/43.8180904,-79.3350555?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto"
curl --request GET --url $curl_url > dark-sky.json curl --request GET --url $curl_url > dark-sky.json
node dark-sky.js > dark-sky.txt node dark-sky.js > dark-sky.csv
./csv-to-html.sh > dark-sky.html

View File

@@ -41,5 +41,6 @@ jsonReader('./dark-sky.json', (err, weatherInfo) => {
Math.floor(hourInfo['precipProbability'])]) Math.floor(hourInfo['precipProbability'])])
} }
log(table(infoList, tableConfig)); // log(table(infoList, tableConfig));
log(infoList.map(row => { return row.join() }).join('\n'))
}) })

1171
github-pandoc.css Normal file

File diff suppressed because it is too large Load Diff

10
index.html Normal file
View File

@@ -0,0 +1,10 @@
<html>
<head>
<script src="csi.js/csi.min.js"></script>
<!-- <script src="http://livejs.com/live.js" charset="utf-8"></script> -->
<link rel="stylesheet" href="github-pandoc.css">
</head>
<body>
<div data-include="dark-sky.html"></div>
</body>
</html>