Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
- made code sane
- simplified everything
- removed all the node wrapper stuff, everything works without
dependencies now
- now using buildkite/terminal for ansi to html conversion (they have
blinking now)
releases 0.2.0
  • Loading branch information
juni-vogt committed Jun 14, 2017
1 parent ea76b46 commit 221baf2
Show file tree
Hide file tree
Showing 81 changed files with 358 additions and 9,676 deletions.
7 changes: 5 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License (ISC)

Copyright (c) 2016, Matthias Vogt (mvogt.me)
Copyright (c) 2017, Matthias Vogt (mvogt.me)

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand All @@ -12,4 +12,7 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


Uses parts of: https://github.com/buildkite/terminal
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# [wttr.in](//wttr.in) [Übersicht](//tracesof.net/uebersicht/) widget
See also: [wttr-moon-uebersicht](https://github.com/matthias-vogt/wttr-moon-uebersicht)

http://tracesof.net/uebersicht-widgets/#wttr-uebersicht

Install: http://tracesof.net/uebersicht-widgets/#installation

You can change the city and language settings in `wttr.widget/index.js`

<img height="160px" width="258px" alt="Screenshot" src="https://raw.githubusercontent.com/matthias-vogt/wttr-uebersicht/master/screenshot.png">
13 changes: 6 additions & 7 deletions wttr.widget/package.json → package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "wttr-uebersicht",
"version": "0.1.0",
"version": "0.2.0",
"description": "wttr.in Übersicht widget",
"main": "index.js",
"main": "wttr.widget/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -14,9 +14,8 @@
"widget"
],
"author": "Matthias Vogt",
"license": "ISC",
"dependencies": {
"ansi-to-html": "^0.5.0",
"node-fetch": "^1.6.3"
}
"homepage": "https://github.com/matthias-vogt/wttr-uebersicht",
"bugs": "https://github.com/matthias-vogt/wttr-uebersicht",
"repository": "https://github.com/matthias-vogt/wttr-uebersicht",
"license": "ISC"
}
Binary file modified wttr.widget.zip
Binary file not shown.
65 changes: 35 additions & 30 deletions wttr.widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,47 @@
// Shows the current wttr.in forecast on your desktop
//

_: (() => this.options = {

city: '', // Berlin
lang: '' // de

// see wttr.io for API
options: {
city: 'newyork', // one word
lang: 'en', // country code
},

})(),

command: `
cd ./wttr.widget &&
# echo 'loading…' &&
{ # hide output
OPTIONS=${escape(JSON.stringify(this.options))} \
/usr/local/bin/node ./src/init-app;
} &> npm-debug.log &&
cat output.html
`,

refreshFrequency: 1000 * 60 * 20,

render: output => output,
refreshFrequency: 1000 * 60 * 30, // 30min

style: `
-webkit-font-smoothing: antialiased // nicer font rendering
// position on screen
bottom: 40px;
left: 20px;
bottom: 100px;
position: fixed;
-webkit-font-smoothing: antialiased; // nicer font rendering
color: #efefef;
font: 16px "DejaVu Sans Mono", Menlo, "Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace;
z-index: 999;
a>*
max-width: 200px
max-height: 200px
pre
font: 16px "DejaVu Sans Mono", Menlo, "Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace;
`,

command: function(cb) {
// this part is unnecessarily complicated because I wanted to have an
// options property

const cmd = `
cd wttr2.widget &&
curl -s wttr.in/${this.options.city}?lang=${this.options.lang} |
./terminal-to-html
`;
// see https://github.com/chubin/wttr.in for API
// uses https://github.com/buildkite/terminal

this.run(cmd, (err, data) => {
cb(this.render({ err, data }))
})
},

render: out => `
<link rel="stylesheet" href="wttr2.widget/terminal-colors.css" />
<pre>
${console.log('out', out) && out.err || out.data.split('\n').slice(1, 7).join('\n')}
</pre>
`
22 changes: 0 additions & 22 deletions wttr.widget/node_modules/ansi-to-html/LICENSE

This file was deleted.

95 changes: 0 additions & 95 deletions wttr.widget/node_modules/ansi-to-html/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions wttr.widget/node_modules/ansi-to-html/bin/ansi-to-html

This file was deleted.

36 changes: 0 additions & 36 deletions wttr.widget/node_modules/ansi-to-html/gruntFile.js

This file was deleted.

Loading

0 comments on commit 221baf2

Please sign in to comment.