Add wthr.ml

This commit is contained in:
2019-09-29 14:57:22 -04:00
parent f2b7a421f9
commit 92df36760b
5 changed files with 15 additions and 8 deletions

6
.gitignore vendored
View File

@@ -1,3 +1,7 @@
server-pages-test.csv
# npm {{{ -
/lib /lib
/lib-legacy /lib-legacy
/node_modules /node_modules
@@ -26,3 +30,5 @@ test/fixtures/**/.fbkpm
.pnp .pnp
/packages/lockfile/index.js /packages/lockfile/index.js
.vscode/ .vscode/
# }}} npm -

View File

@@ -31,8 +31,8 @@ following output:
## Built With ## Built With
* [csvtojson] - Convert my base CSV to JSON. * [csvtojson]
* [url-metadata] - Fetch my pages for their titles. * [url-metadata] - Fetch pages for their titles.
[csvtojson]: https://www.npmjs.com/package/csvtojson [csvtojson]: https://www.npmjs.com/package/csvtojson
[url-metadata]: https://www.npmjs.com/package/url-metadata [url-metadata]: https://www.npmjs.com/package/url-metadata

View File

@@ -1,2 +0,0 @@
shortUrl,url,siteTitle,description,repo,repoUrl
kevin-mok.com,https://kevin-mok.com," Kevin Mok ","Personal site (this site).",Kevin-Mok/my-site,https://git.kevin-mok.com/Kevin-Mok/my-site
1 shortUrl url siteTitle description repo repoUrl
2 kevin-mok.com https://kevin-mok.com Kevin Mok Personal site (this site). Kevin-Mok/my-site https://git.kevin-mok.com/Kevin-Mok/my-site

View File

@@ -1,9 +1,11 @@
shortUrl,url,siteTitle,description,repo,repoUrl shortUrl,url,siteTitle,description,repo,repoUrl
kevin-mok.com,https://kevin-mok.com," Kevin Mok ","Personal site (this site).",Kevin-Mok/my-site,https://git.kevin-mok.com/Kevin-Mok/my-site
git.kevin-mok.com,https://git.kevin-mok.com,"Kevin Mok's Gitea","Lightweight Git server.",go-gitea/gitea,https://github.com/go-gitea/gitea
cal.khkm.tk,https://cal.khkm.tk,"Baïkal server","CalDAV/CardDAV server.",sabre-io/Baikal,https://github.com/sabre-io/Baikal cal.khkm.tk,https://cal.khkm.tk,"Baïkal server","CalDAV/CardDAV server.",sabre-io/Baikal,https://github.com/sabre-io/Baikal
git.kevin-mok.com,https://git.kevin-mok.com,"Kevin Mok's Gitea","Git server.",go-gitea/gitea,https://github.com/go-gitea/gitea
img.khkm.tk,https://img.khkm.tk,"Kevin's Images","Image hosting.",LycheeOrg/Lychee,https://github.com/LycheeOrg/Lychee/
kevin-mok.com,https://kevin-mok.com," Kevin Mok ","Personal site (this site).",Kevin-Mok/my-site,https://git.kevin-mok.com/Kevin-Mok/my-site
matrix.ataraxy.tk,https://matrix.ataraxy.tk/.well-known/matrix/server,,"Matrix chat server. Only accessible through Riot client.",matrix-org/synapse,https://github.com/matrix-org/synapse matrix.ataraxy.tk,https://matrix.ataraxy.tk/.well-known/matrix/server,,"Matrix chat server. Only accessible through Riot client.",matrix-org/synapse,https://github.com/matrix-org/synapse
mnpd.gq,https://mnpd.gq/test,"test","Minimalistic live web notepad.",pereorga/minimalist-web-notepad,https://github.com/pereorga/minimalist-web-notepad mnpd.gq,https://mnpd.gq/test,"test","Minimalistic live notepad.",pereorga/minimalist-web-notepad,https://github.com/pereorga/minimalist-web-notepad
pste.gq,https://pste.gq,"hastebin","Pastebin.",seejohnrun/haste-server,https://github.com/seejohnrun/haste-server pste.gq,https://pste.gq,"hastebin","Pastebin.",seejohnrun/haste-server,https://github.com/seejohnrun/haste-server
smol.gq,https://smol.gq,"Kevin's URL Shortener","URL shortener.",132ikl/liteshort,https://github.com/132ikl/liteshort smol.gq,https://smol.gq,"Kevin's URL Shortener","URL shortener.",132ikl/liteshort,https://github.com/132ikl/liteshort
taskd.khkm.tk,taskd.khkm.tk:53589,,"Taskwarrior (task manager) server. No web interface.",GothenburgBitFactory/taskserver,https://github.com/GothenburgBitFactory/taskserver taskd.khkm.tk,taskd.khkm.tk:53589,,"Taskwarrior (task manager) server. No web interface.",GothenburgBitFactory/taskserver,https://github.com/GothenburgBitFactory/taskserver
wthr.ml,https://wthr.ml/,," <code>curl</code>-friendly, local weather info. <a href="https://regexr.com/4mgna" target="_blank"><code>\/m?t?v?</code></a> are all valid endings.",Kevin-Mok/weather,https://git.kevin-mok.com/Kevin-Mok/weather
Can't render this file because it contains an unexpected character in line 11 and column 85.

View File

@@ -10,7 +10,8 @@ const csvFilePath = 'server-pages.csv'
// consider webpage to be up if stored title matches fetched title // consider webpage to be up if stored title matches fetched title
const checkIfTitleMatches = obj => { const checkIfTitleMatches = obj => {
return urlMetadata(obj['url']).then(metadata => { // success handler return urlMetadata(obj['url']).then(metadata => { // success handler
if (metadata.title == obj['siteTitle']) { // log(metadata.title, obj['siteTitle'])
if (metadata.title == obj['siteTitle']) {
obj['status'] = 'up' obj['status'] = 'up'
} else { } else {
obj['status'] = 'down' obj['status'] = 'down'