You are not logged in.
forecast is a query program for the forecast.io weather API. It provides a command line interface which makes weather data for a configurable location available in the terminal. It does text output and graphical plots using ncurses. forecast is still under heavy development and features are being added on a rolling basis.
Many aspects, including colors and label formats, can be configured by the user.
Suggestions, bug reports and testers are very welcome.
$ forecast -m print
Latitude | 52.5161
Longitude | 13.3770
Timezone | Europe/Berlin
-------------------------+
Currently
-------------------------+
Time | Wed Apr 29 22:27:40 2015
Condition | Mostly Cloudy
Temperature | 9.8 °C
Apparent temperature | 8.1 °C
Dew point | -1.8 °C
Precipitation | 0 %
RH (φ) | 44.0 %
Wind speed | 11 kph (SSE)
Cloud cover | 61 %
Pressure | 1017.98 hPa
Ozone | 357.09 DU
$ forecast -m plot-hourly
$ forecast -m plot-daily
Usage:
forecast [c:dhL:l:m:rv] [OPTIONS]
Options:
-c|--config PATH Configuration file to use
-d|--dump Dump the JSON data and a newline to stdout
-h|--help Print this message and exit
-L|--location-by-name NAME Select a location predefined in the configuration file
-l|--location CHOORD Query the weather at this location; CHOORD is a string in the format
<latitude>:<longitude> where the choordinates are given as floating
point numbers
-m|--mode MODE One of print, print-hourly, plot-hourly, plot-daily, plot-precip-daily,
plot-precip-hourly, plot-daylight. Defaults to 'print'
-r|--request By pass the cache if a cache file exists
-v|--version Print program version and exit
Read the supplied README file. The man page is still incomplete.
You need to read this.
Debian and Ubuntu users may install the package from the BL-hydrogen repository. Set up the repository, then just do
$ sudo apt-get install forecast
Arch users may install from the AUR: forecast-git.
The project is being developed on Github: 2ion/forecast.
Of course, GPLv3+.
No imperial units.
Last edited by twoion (2015-04-30 17:14:18)
Offline
I've installed it from the AUR and used the config file provided in the README (with the location co-ordinates changed to London) and I get this (error code given before the prompt on the line after the command):
empty@Arch ~ % forecast -m plot-daily
[1] 559 segmentation fault (core dumped) forecast -m plot-daily
139 empty@Arch ~ % uname -a :(
Linux Arch 4.0.1-1-ARCH #1 SMP PREEMPT Wed Apr 29 12:00:26 CEST 2015 x86_64 GNU/Linux
Here is my ~/.forecastrc
# forecast.io API key
apikey = "";
# Default mode for forecast when invoked without any command line
# options. Must be one of print, print-hourly, plot-hourly, plot-daily.
op = "print";
# Location coordinates as doubles
location: {
latitude = 51.5333;
longitude = 0.0833;
};
# Plot appearance
plot: {
# The plot's y axis will extend to +/- this value in terminal lines
height = 10;
bar: {
# Bar width in columns
width = 5;
# Primary bar color
# One of: WHITE, BLACK, RED, GREEN, CYAN, BLUE, MAGENTA, YELLOW
# Name must be uppercase
color = "RED";
# Secondary bar color in overlay plots (currently only plot-daily)
overlay_color = "BLACK";
};
legend: {
# Color used for labels
color = "WHITE";
# Color used for highlight/color accents in text
texthighlight_color = "RED";
};
hourly: {
# plot-hourly: Consecutive hours to plot
succeeding_hours = 30;
# Bar labels, see strftime(3) for possible formats
label_format = "%H:%M";
};
daily: {
# Bar labels, see strftime(3) for possible formats
label_format = "%d%b";
};
};
What have I done wrong?
EDIT: Also:
empty@Arch ~ % forecast -m print
Latitude | 0.0000
Longitude | 0.0000
Timezone | (null)
-------------------------+
Currently
forecast: render.c:112: render_datapoint: Assertion `o' failed.
[1] 691 abort (core dumped) forecast -m print
134 empty@Arch ~ % :(
My apologies if I've missed something obvious here, I'm very tired ATM...
Last edited by Head_on_a_Stick (2015-04-29 21:17:46)
Offline
^ You didn't obtain an API key from https://developer.forecast.io/ and put in into the currently zero-length key "apikey" in the config file I currently don't guard against (almost) everything the user could do wrong because, as you know, code first and documentation plus sanity later.
I don't ship a key because I haven't read the TOS of forecast.io, and because API are limited to 1000/day per key.
Sorry. You could use a service such as anonbox.net for getting the key.
Oh and thanks for testing
Last edited by twoion (2015-04-29 21:56:54)
Offline
on wheezy
make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/b/source/forecast/missing aclocal-1.15
/home/b/source/forecast/missing: line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
aclocal --version
aclocal (GNU automake) 1.11.6
I guess it must be Jessie?
Last edited by brontosaurusrex (2015-04-29 22:19:52)
Offline
^ No, it doesn't need to be Jessie. This is just autotools...Try running this in the ./forecast directory:
autoreconf --force --install --symlink --make
The error you see happens when the autoconf/automake/aclocal stuff was generated with different autotool versions from what is available on the system.
I should add an 'autogen.sh' script in order to prevent this.
Thanks, I hadn't considered this.
--
Edit: AFK for the night
Last edited by twoion (2015-04-29 22:24:52)
Offline
New 0.3 release.
Precepitation plots (-m plot-precip-daily, -m precip-hourly) and caching have been added (damn fast now!) as well as some checks for user input (-> HoaS ).
The configuration file has gained some more keys, so be sure to use an up-to-date config file!
Updated synopsis:
Usage:
forecast [c:dhl:m:rv] [OPTIONS]
Options:
-c|--config PATH Configuration file to use
-d|--dump Dump the JSON data and a newline to stdout
-h|--help Print this message and exit
-l|--location CHOORD Query the weather at this location; CHOORD is a string in the format
<latitude>:<longitude> where the choordinates are given as floating
point numbers
-m|--mode MODE One of print, print-hourly, plot-hourly, plot-daily, plot-precip-daily,
plot-precip-hourly. Defaults to 'print'
-r|--request By pass the cache if a cache file exists
-v|--version Print program version and exit
Offline
Offline
Is it possible to get a print out for a specific day/date?
Glad you like it.
No date/time specs yet. Good idea though; the available data however is today+7d and now+48h. I'll got to this when I have the time.
Offline
Announcing forecast 0.4.
Querying the weather for multiple locations has been made easier.
You can now define an arbitrary number of named locations in the configuration file:
location_map: {
Berlin: [ 52.5161, 13.3770 ];
Tokyo: [ 35.7000, 139.7667 ];
};
and reference these locations directly from the command line instead of having to invoke forecast with explicit coordinates:
$ forecast -L Tokyo # or forecast --location-by-name Tokyo
Correspondingly, the cache system now maintains an extra cache for each unique location.
OpenSSL is a new dependency (for the md5 hash algo).
I hope you like it.
Offline
- Using LZ4 compression reduces the file size of inidivial
cache files from ~20K to ~5K (depending on your filesystem's
block size, it might still occupy at least one block, for example 8K).
- Bump to 0.5 since all existing cache files need to be re-genereated.
Feature creep, I say.
The package is now available through the BunsenLabs repository at http://pkg.bunsenlabs.org.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat