Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
055e1b4ebf
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
*.csv
|
||||||
|
*.html
|
||||||
*.txt
|
*.txt
|
||||||
|
|
||||||
api-keys-fish.sh
|
api-keys-fish.sh
|
||||||
|
|||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "csi.js"]
|
||||||
|
path = csi.js
|
||||||
|
url = https://github.com/LexmarkWeb/csi.js
|
||||||
1
csi.js
Submodule
1
csi.js
Submodule
Submodule csi.js added at 2d99a233a5
14
csv-to-html.sh
Executable file
14
csv-to-html.sh
Executable 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>"
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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
1171
github-pandoc.css
Normal file
File diff suppressed because it is too large
Load Diff
10
index.html
Normal file
10
index.html
Normal 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>
|
||||||
Reference in New Issue
Block a user