Permalink
Browse files

Preliminary support for screenwidth.

  • Loading branch information...
1 parent 51f21d0 commit b2516f8afb5c2c06ef18a50e685c5e95c9f5559b @ways committed Aug 14, 2012
Showing with 14 additions and 11 deletions.
  1. +12 −10 README
  2. +2 −1 pyyrascii.py
View
22 README
@@ -12,10 +12,12 @@ The service can be used in the following ways:
* finger newyork@graph.no - international city name. These are not hourly. Only data for every 6 hours available.
* o:oslo to get a one-liner for use in screen, tmux, scripts.
* finger <city name>+5@graph.no (forecast from 5 hours ahead in time, max:26)
+* finger <city name>%2@graph.no (forecast every 2 hours instead of every hour)
+* finger <city name>~100@graph.no (set screenwidth. default 80. other widths may be ugly)
* finger @graph.no - for more information
Availability:
-* Finger is supported on all major platforms (Windows, OS X, Linux, FreeBSD, Android, ...)
+* Finger is supported on all major platforms (Windows, OS X, Linux, FreeBSD, Android, ...). Open up your terminal (or cmd.exe on Windows).
* If you don't have finger available, but have some standard shell tools, try one of the following:
** echo oslo|nc graph.no 79
** telnet graph.no 79 (and then type oslo)
@@ -32,18 +34,18 @@ $ finger oslo@graph.no
15 ---
13 ---
11 ---
- 9 --- ---
- 7 --- ~~~
- 5 ~~~--- ~~~
- 3 ------~~~~~~ ~~~
- 1 ~~~~~~~~~
+ 9 ---
+ 7 ^^^=== ^^^
+ 5 ===--- ^^^
+ 3 | ------^^^^^^ ^^^ 2 mm
+ 1 | | ^^^^^^^^^ 1 mm
15 16 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 Hour
SW SW SW W NW NW NW W W W W SW SW SW S S S S S SW SW SW Wind dir.
3 2 2 3 3 3 3 2 2 2 2 2 2 2 2 2 3 6 7 6 7 7 Wind(mps)
-Legend left axis: - Sunny ~ Scattered = Clouded =/= Lightning # Fog
-Legend right axis: | Rain ! Sleet * Snow
+Legend left axis: - Sunny ^ Scattered = Clouded =V= Lightning # Fog
+Legend right axis: | Rain ! Sleet * Snow ' High uncertainty
Weather forecast from yr.no, delivered by the Norwegian Meteorological Institute and the NRK. Try "finger @graph.no" for more info.
@@ -71,8 +73,8 @@ TODO
* FEATURE: Make rainbars scale if value is off the chart.
* FEATURE: Add arguments to get weather in different format:
** i:0458 to get an iconic view. ("Fullscreen" or small?)
-** 0458%3 to get every three hours instead of every hour.
-** w90:0458 to set width of output
+* BUG: Fix/improve 0458~90 to set width of output
+* FEATURE: improve 0458%3
* FEATURE: Include random messages at bottom. Example: Send bugs to... Thank you for using... Did you know...? No. of users last hour. Top location.
* FEATURE: Include warnings (obsforecast). Example:
<forecast>
View
3 pyyrascii.py
@@ -54,7 +54,8 @@ def get_pyyrascii (location, offset = 0, hourstep = 1, screenwidth = 80):
temphigh = -99
templow = 99
tempstep = -1
- hourcount = 22 + offset
+ #hourcount = 22 + offset
+ hourcount = (screenwidth-14)/3 + offset
#screenwidth = 80
#rain in graph:
rainheight = 10

0 comments on commit b2516f8

Please sign in to comment.