Giter Site home page Giter Site logo

weather's Introduction

weather

make-all make-image GoDoc Github All Releases

Weather via the command line. Uses the darksky.net API so it's super accurate. Also includes any current weather alerts in the output.

Screenshot

Table of Contents

Installation

Binaries

For installation instructions from binaries please visit the Releases Page.

Via Go

$ go get github.com/genuinetools/weather

Via Homebrew

$ brew install darksky-weather

Usage

$ weather -h
weather -  Weather forecast via the command line.

Usage: weather <command>

Flags:

  -c              Get location for the ssh client (shorthand) (default: false)
  -client         Get location for the ssh client (default: false)
  -d              No. of days to get forecast (shorthand) (default: 0)
  -days           No. of days to get forecast (default: 0)
  -hide-icon      Hide the weather icons from being output (default: false)
  -ignore-alerts  Ignore alerts in weather output (default: false)
  -l              Location to get the weather (shorthand) (default: <none>)
  -location       Location to get the weather (default: <none>)
  -no-forecast    Hide the forecast for the next 16 hours (default: false)
  -s              Weather API server uri (shorthand) (default: https://geocode.jessfraz.com)
  -server         Weather API server uri (default: https://geocode.jessfraz.com)
  -u              System of units (shorthand) (e.g. auto, us, si, ca, uk2) (default: auto)
  -units          System of units (e.g. auto, us, si, ca, uk2) (default: auto)

Commands:

  version  Show the version information.

Examples

# get the current weather in your current location
$ weather

# change the units to metric
$ weather -l "Paris, France" -u si

# it will auto guess the units though so changing
# the location to paris will change the units to `si`
$ weather -l "Paris, France"

# get three days forecast for NY
$ weather -l 10028 -d 3

# or you can autolocate and get three days forecast
$ weather -d 3

# get the weather in Manhattan Beach, CA
# even includes alerts
$ weather -l "Manhattan Beach, CA"
#                             .;odc
#                           ;kXNNNO
#                         .0NNO0NN:
#                        'XNK; dNNl
#                        KNX'  'XNK.
#                       ,NNk    cXNK,
#                       ,NNk     '0NNO:.
#                     .'cXNXl;,.   ,xXNNKOxxxk0Xx
#                 'lOXNNNNNNNNNNXOo'  ':oxkOXNNXc
#               cKNNKd:'.    ..;d0NNKl    ,xXNK,
#        .;:cclKNXd.              .oXNXxOXNNXl
#    .cOXNNNNNNNO.                  .kNNNNNNNXOc.
#   lXNXx;.    .                      .    .;dXNXo
#  ONNd.                                       oXN0.
# dNNo                                          cNNk
# XNN.                                           NNX
# 0NN'                                          .NNK
# ;XN0.                                        .ONNc
#  ;XNXo.                                    .lXNX:
#   .oXNX0dlcclx0Xo.              .oXKxlccldOXNXd.
#      ,lk0KXXK0xKNN0o;..    ..;o0NNKx0KXXX0ko,
#                 'lOXNNNNNNNNNNXOo,
#                     :x0XNNX0x:.
#
#
# Current weather is Partly Cloudy in Manhattan Beach in California for July 14 at 4:14am EDT
# The temperature is 69.2°F, but it feels like 69.2°F
#
# Special Weather Statement for Los Angeles, CA
# ...THREAT OF MONSOONAL THUNDERSTORMS LATE TONIGHT THROUGH WEDNESDAY...
# A STRONG UPPER LEVEL HIGH PRESSURE SYSTEM CURRENTLY CENTERED OVER NEVADA
# WILL BRING INCREASING EAST TO SOUTHEAST FLOW OVER SOUTHERN
# CALIFORNIA. AS A RESULT...A SIGNIFICANT SURGE OF MONSOONAL MOISTURE
# WILL MOVE INTO SOUTHWEST CALIFORNIA LATE TONIGHT THROUGH WEDNESDAY.
# THE GREATEST THREAT OF SHOWERS AND THUNDERSTORMS WILL BE ACROSS THE
# MOUNTAINS AND ANTELOPE VALLEY LATE TONIGHT INTO TUESDAY. DUE TO THE
# EASTERLY UPPER LEVEL FLOW ON MONDAY...THERE WILL ALSO BE A SLIGHT
# CHANCE OF SHOWERS AND THUNDERSTORMS ACROSS MOST COASTAL AND VALLEY
# AREAS.
# THE DEEPER MONSOONAL MOISTURE WILL BRING THE POTENTIAL FOR BRIEF HEAVY
# RAINFALL WITH STORMS THAT DEVELOP ON MONDAY AND TUESDAY...ESPECIALLY
# ACROSS THE MOUNTAINS AND ANTELOPE VALLEY. WHILE STORMS ARE EXPECTED
# TO BE FAST MOVING...THERE WILL BE THE POTENTIAL FOR LOCALIZED FLOODING
# OF ROADWAYS AND ARROYOS. ON TUESDAY...THE THREAT OF THUNDERSTORMS IS
# EXPECTED TO REMAIN CONFINED TO THE MOUNTAINS AND DESERTS. WITH WEAKER
# UPPER LEVEL WINDS ON TUESDAY...STORMS WILL LIKELY MOVE SLOWER. AS A
# RESULT...THERE WILL BE AN INCREASED THREAT OF FLASH FLOODING.
# IT WILL NOT BE AS HOT ACROSS MUCH OF THE REGION TOMORROW DUE TO THE
# INCREASED MOISTURE AND CLOUD COVERAGE...WITH INTERIOR SECTIONS
# GENERALLY REMAINING IN THE 90S. HOWEVER...THERE WILL BE A
# SIGNIFICANT INCREASE IN HUMIDITY ON MONDAY THAT WILL CONTINUE TO
# BRING DISCOMFORT.
# ANYONE PLANNING OUTDOOR ACTIVITIES IN THE MOUNTAINS AND DESERTS
# DURING THE NEXT FEW DAYS SHOULD CAREFULLY MONITOR THE LATEST
# NATIONAL WEATHER SERVICE FORECASTS AND STATEMENTS DUE TO THE
# POTENTIAL HAZARDS ASSOCIATED WITH THUNDERSTORMS.
#             Created: July 13 at 10:50pm EDT
#             Expires: July 14 at 7:00pm EDT
#
# Ick! The humidity is 85%
# The nearest storm is 18 miles NE away
# The wind speed is 3.96 mph SE
# The cloud coverage is 35%
# The visibility is 9.58 miles
# The pressure is 1012.99 mbar

Running the Server

API Server for weather command line tool. Connects to the Google Geocode API and darksky.net API.

Usage

$ weather server -h
Usage: weather server [OPTIONS]

Run a static UI server for a registry.

Flags:

  -cert            path to ssl cert (default: <none>)
  -darksky-apikey  Key for darksky.net API (default: <none>)
  -geocode-apikey  Key for Google Maps Geocode API (default: <none>)
  -key             path to ssl key (default: <none>)
  -port            port for server to run on (default: 1234)

Running with Docker

$ docker run --restart always -d \
    --name weather-server \
    -p 1234:1234 \
    r.j3ss.co/weather server \
    --geocode-apikey "YOUR_GOOGLE_GEOCODING_APIKEY" \
    --darksky-apikey "YOUR_DARKSKY.NET_APIKEY"

Contributing

Please do!

Makefile Usage

$ make help
all                            Runs a clean, build, fmt, lint, test, staticcheck, vet and install
build                          Builds a dynamic executable or package
bump-version                   Bump the version in the version file. Set BUMP to [ patch | major | minor ]
clean                          Cleanup any build binaries or packages
cover                          Runs go test with coverage
cross                          Builds the cross-compiled binaries, creating a clean directory structure (eg. GOOS/GOARCH/binary)
fmt                            Verifies all files have been `gofmt`ed
install                        Installs the executable or package
lint                           Verifies `golint` passes
release                        Builds the cross-compiled binaries, naming them in such a way for release (eg. binary-GOOS-GOARCH)
static                         Builds a static executable
staticcheck                    Verifies `staticcheck` passes
tag                            Create a new git tag to prepare to build a release
test                           Runs the go tests
vet                            Verifies `go vet` passes

Analytics

weather's People

Contributors

azillion avatar binford2k avatar codingsince1985 avatar commitay avatar dargad avatar filosottile avatar github-actions[bot] avatar imgbot[bot] avatar jessfraz avatar m4ns0ur avatar marcosnils avatar menski avatar mrala avatar pawelszulczewski avatar polyzen avatar sanderpick avatar screwgoth avatar simon04 avatar smalldave avatar sonnens avatar tarsisazevedo avatar thajeztah avatar tianon avatar toc-me[bot] avatar vielmetti avatar wayneashleyberry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weather's Issues

homebrew recipe?

for osx folks, brew install weather would be great! there's no formula that's claimed the name, yet, either.

Not displaying the location

Hey! Cool app!

I notice that I'm not getting my location in the output.

thomas@workstation:jspm-npm$ weather
                   xX:
                  .NNK
                  .NN0
     .OOc          ,:.         .d0k
     .dXNXc                   xXNXl
       .ld;   .cdOKXXX0ko;.   cd:
            :0NNKkocccoOXNXk'
          .ONNk'         :KNNd
          0NXc             kNNo
'cccc;   cNNx       .,;:cc:cXNX.   :ccc:.
xXNNX0.  oNNl   'lOXNNNNNNNNNNN0o';KNNNXc
         'XNK.cKNNKd:..    ..:dKNNKl.
       .,:0NNNNXd.              .oXNXocc:;'
   .ckXNNNNNNNO.                  .kNNNNNNNXOl.
  lXNXx;.   ..                      .    .;dXNXd
 ONNd.                                       oXN0.
dNNo                                          cNNk
XNN.                                           NNX
0NN'                                          .NNK
;XN0.                                        .ONNc
 ;XNXo.                                    .lXNX:
  .oXNX0dlcclx0Xo.              .oXKxlccldOXNXd.
     ,lk0KXXK0xKNN0o;..    ..;o0NNKx0KXXX0ko,
                'lOXNNNNNNNNNNXOo,
                    :x0XNNX0x:.

Current weather is Partly Cloudy in  in  for January 8 at 11:12am EST
The temperature is 15.66°F, but it feels like -2.2°F

Ick! The humidity is 65%
The nearest storm is 26 miles ENE away
The wind speed is 22.07 mph SE
The cloud coverage is 25%
The visibilty is 9.98 miles
The pressure is 1026.77 mbar

I also noticed that the screenshot says in New York in New York which should either say in New York, New York or just in New York

Travis build checks failing due to "staticcheck"

The staticcheck piece of the Travis configuration is currently failing, due to a few nit-picky considerations of Go style, things like lowercasing the first character of error messages and not doing an explicit return at the end of functions that don't return a value.

In the #63 PR there are changes to fix these so that the tests pass again.

Error instead of weather forecast: Decoding geocode response failed

Hi!

I'm unable to display weather information in terminal :(

$ weather -l "Paris, France"
Decoding geocode response failed: invalid character '<' looking for beginning of value

I'm enclosing information about my system and configuration below.

If you need more details to examine the issue, let me know.

$ weather version
weather:
 version     : v0.15.6
 git hash    : homebrew
 go version  : go1.11.1
 go compiler : gc
 platform    : darwin/amd64
$ go version
go version go1.11.4 darwin/amd64
$ neofetch --off
[email protected]
----------------------------------
OS: macOS Mojave 10.14.2 18C54 x86_64
Host: MacBookAir7,2
Kernel: 18.2.0
Uptime: 18 days, 3 hours, 59 mins
Packages: 261 (brew)
Shell: bash 4.4.23
Resolution: 1440x900, 1920x1080
DE: Aqua
WM: Spectacle
Terminal: iTerm2
Terminal Font: Monaco 11
CPU: Intel i5-5350U (4) @ 1.80GHz
GPU: Intel HD Graphics 6000
Memory: 3533MiB / 8192MiB

By the way, I've tried to reinstall the utility and its dependency (go) but it hasn't helped.

$ brew uninstall darksky-weather
Uninstalling /usr/local/Cellar/darksky-weather/0.15.6... (5 files, 7.3MB)
$ brew uninstall go
Uninstalling /usr/local/Cellar/go/1.11.4... (9,298 files, 404.3MB)
$ brew install darksky-weather
==> Downloading https://homebrew.bintray.com/bottles/darksky-weather-0.15.6.mojave.bottle.tar.gz
Already downloaded: /Users/joachim/Library/Caches/Homebrew/downloads/283aa2f8787e288ea136e2269e702081b86b51689f87990ddd86bdf02cec6a6d--darksky-weather-0.15.6.mojave.bottle.tar.gz
==> Pouring darksky-weather-0.15.6.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/darksky-weather/0.15.6: 5 files, 7.3MB
$ weather
Decoding forecast response failed: invalid character '<' looking for beginning of value

VERSION and version/ overlap

OMG it took me forever to figure out why checking out VERSION was deleting version/version.go.

Jess uses Linux of course.

Please rename one of the two for your macOS friends ✨

Proposal: Should I take an umbrella?

Printing hourly.summary or a visualization of hourly.data[].precipProbability would tell us if it's going to rain this evening, or if there's hope to go on a stroll in Central Park later.

Doesn't work anymore :(

One of the APIs the utility uses is not available, anymore: http://www.telize.com/geoip. From their website (as of Nov 15, 2015):

IMPORTANT INFORMATION
The public API will permanently shut down on November 15th, 2015. More information can be found here. To continue using Telize after this date, please spin up your own instance or subscribe to a paid plan.

Error for locations on timezone whose offsets do not fall on exactly the hour

I live in India and my timezone w.r.t. to GMT is +5.5 hours.
As a result, i reckon the geocode API must be returning the offset as 5.5.
So, when I run weather for Mumbai, here's what I get

$ weather -l "Mumbai"
Decoding forecast response failed: json: cannot unmarshal number 5.5 into Go value of type int

Interestingly enough, when I invoke weather without location parameter I get the following

$ weather
...
Current weather is Drizzle in  in  for December 7 at 3:56pm IST
...

And it goes on to show the weather info of some city... I wonder which ?

Support for other weather backends

Awesome app! I use it daily.

It'd be awesome if there was support for other weather backends to check different weather sources and compare their predictions manually. 🌤

openweathermap.org has a decent API, so does yr.no (which is very accurate in Europe).

Thank you!

Thanks for putting in Amber alerts!

micahhausler@ip-10-101-71-37:~$ weather
                   xX:
                  .NNK
                  .NN0
     .OOc          ,:.         .d0k
     .dXNXc                   xXNXl
       .ld;   .cdOKXXX0ko;.   cd:
            :0NNKkocccoOXNXk'
          .ONNk'         :KNNd
          0NXc             kNNo
'cccc;   cNNx       .,;:cc:cXNX.   :ccc:.
xXNNX0.  oNNl   'lOXNNNNNNNNNNN0o';KNNNXc
         'XNK.cKNNKd:..    ..:dKNNKl.
       .,:0NNNNXd.              .oXNXocc:;'
   .ckXNNNNNNNO.                  .kNNNNNNNXOl.
  lXNXx;.   ..                      .    .;dXNXd
 ONNd.                                       oXN0.
dNNo                                          cNNk
XNN.                                           NNX
0NN'                                          .NNK
;XN0.                                        .ONNc
 ;XNXo.                                    .lXNX:
  .oXNX0dlcclx0Xo.              .oXKxlccldOXNXd.
     ,lk0KXXK0xKNN0o;..    ..;o0NNKx0KXXX0ko,
                'lOXNNNNNNNNNNXOo,
                    :x0XNNX0x:.

Current weather is Mostly Cloudy in Chattanooga in Tennessee for October 22 at 9:27am EDT
The temperature is 51.72°F, but it feels like 51.72°F

Child Abduction Emergency for Hamilton, TN
THIS IS A CHILD ABDUCTION EMERGENCY TRASMITTED AT THE REQUEST OF THE
TENNESSEE BUREAU OF INVESTIGATION
AN EAST TENNESSEE AMBER ALERT HAS BEEN ISSUED FOR THE
...
SUBJECTS, CALL THE KNOXVILLE POLICE DEPARTMENT AT 865-215-
7212 OR THE TBI AT 1-800-TBI-FIND. NIC#M592904082
            Created: October 22 at 8:30am EDT
            Expires: October 22 at 10:30am EDT

Ick! The humidity is 88%
The nearest storm is 210 miles SE away
The wind speed is 2.17 mph E
The cloud coverage is 83%
The visibility is 3.47 miles
The pressure is 1027.45 mbar

is the darksky api dead?

Sadly, it seems that apple has bought darksky
weather -l loc
decoding forecast response failed: invalid character '<' looking for beginning of value

Failures in basic.mk recipes can be lost in pipes

basic.mk is my go-to starting point for Go projects, thanks!

I noticed that a CI job of mine was missing golint, but make all was succeeding. The golint | tee approach was hiding the error return code.

Adding .SHELLFLAGS = -o pipefail -c fixed it for me (i.e. the build now correctly fails if golint is missing).

I see basic.mk has moved on a bit from the version I'm working from, I don't know if the greps in the pipes might mean this approach isn't viable any more?

Just raising this issue in case it's helpful - this isn't an issue with the weather tool, but I couldn't see a 'home' repo for basic.mk. Please do close it if this is the wrong project or this isn't a problem in your use case!

Google Geocode API Limit

I tried the example in the README and got issues with Geocode API:

weather -l "Paris, France" -u si
Geocode API response error: Google Geocode API response error: OVER_QUERY_LIMIT - You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account: http://g.co/dev/maps-no-account

Something to do on user or on software side (or both)?

Get segmentation fault on WSL

On WSL I get "Segmentation fault" if I don't run it with "sudo" the first time. After one run with sudo it works as a normal user.

My WSL version= Description: Ubuntu 14.04.5 LTS

white on white output for humidity, wind speed, cloud coverage and pressure

I just tried your weather cli and it's great!

I couldn't see the humidity for Montreal, so I changed to New York, same thing. Turns out the humidity (and other values) are there, but they are white on white with rxvt (white background). When I copy/paste the white text. I see the output is actually there.

An option to change the color scheme or some other form of autodetection would be appreciated.

Dockerfile fails to build an image

Ubuntu 17.04

After

git clone https://github.com/jessfraz/weather.git

When I try to use the Dockerfile with a basic

docker build -t k3ck3c/meteo .
I get
...
(20/24) Installing gcc (5.3.0-r0)
(21/24) Installing musl-dev (1.1.12-r8)
(22/24) Installing libc-dev (0.7-r0)
(23/24) Installing .build-deps (0)
(24/24) Upgrading musl-utils (1.1.12-r4 -> 1.1.12-r8)
Executing busybox-1.24.1-r7.trigger
OK: 280 MiB in 35 packages

  • cd /go/src/github.com/jessfraz/weather
  • go build -o /usr/bin/weather .
    forecast/print.go:11:2: cannot find package "github.com/mitchellh/colorstring" in any of:
    /usr/lib/go/src/github.com/mitchellh/colorstring (from $GOROOT)
    /go/src/github.com/mitchellh/colorstring (from $GOPATH)
    The command '/bin/sh -c set -x && apk add --no-cache --virtual .build-deps go git gcc libc-dev libgcc && cd /go/src/github.com/jessfraz/weather && go build -o /usr/bin/weather . && apk del .build-deps && rm -rf /go && echo "Build complete."' returned a non-zero code: 1

I slightly modified the Dockerfile

&& cd /go/src/github.com/jessfraz/weather \
&& go get github.com/mitchellh/colorstring \
&& go build -o /usr/bin/weather . \

and it works

$ docker images k3ck3c/meteo
REPOSITORY TAG IMAGE ID CREATED SIZE
k3ck3c/meteo latest 52c917fdeacf 6 minutes ago 14.9MB

Thanks for your work

Check for low visibility should be depend on unit

As far as we have a check for low visibility in forecast, it's only working based on the us units.
IMO we should calculate it in the API and regarding to the units.

$ weather -u us
        .,.
     ,dKNNX.
   ,0NNXNNk
  oXNO':NNx
 lNNk  .XNX.
 XNX.   cNN0.
.NNX     :XNXo.
 0NN,      lKNNKxc;,,:ldl
 ,XNK.       'lkKXNNNNNNK.
  ,KNXo.          .:0NNO.
    oXNNOl;'...':dKNNK:
      ,d0XNNNNNNNXOo'
          .',,,'.

Current weather is Clear in Rotterdam in South Holland for July 15 at 11:21pm CEST
The temperature is 68.55°F

  Ick! The humidity is 60.00%
  The wind speed is 2.98 mph NE
  The cloud coverage is 5.00%
  The visibility is 8.7 miles
  The pressure is 1015.3 mbar

Mostly cloudy starting tomorrow morning.
$ weather
        .,.
     ,dKNNX.
   ,0NNXNNk
  oXNO':NNx
 lNNk  .XNX.
 XNX.   cNN0.
.NNX     :XNXo.
 0NN,      lKNNKxc;,,:ldl
 ,XNK.       'lkKXNNNNNNK.
  ,KNXo.          .:0NNO.
    oXNNOl;'...':dKNNK:
      ,d0XNNNNNNNXOo'
          .',,,'.

Current weather is Clear in Rotterdam in South Holland for July 15 at 11:22pm CEST
The temperature is 20.31°C

  Ick! The humidity is 60.00%
  The wind speed is 1.33 m/s NE
  The cloud coverage is 5.00%
  The pressure is 1015.3 mbar

Mostly cloudy starting tomorrow morning.

when weather API (darksky) is down, fail more gracefully

Took latest from master as of this issue and make install succeeds but then subsequent run of binary weather returns the following error:

Decoding forecast response failed: invalid character 'F' looking for beginning of value

Mac OSX 10.13.4

Explicit latitude/longitude settings for weather forecast lookup

If the geocoder API is over limit (see #54) you get an error rather than a forecast.

Handle the case where you know exactly where you are already, and pass in the latitude and longitude directly to the API, e.g. support queries like so:

weather --latitude 42.27756 --longitude -83.74088

which will give you Ann Arbor, MI, or the same output more or less as

weather -l "Ann Arbor, MI"

I have a work in progress to do this - the only small hitch so far is that the output routine counts on there being a nice name for the location.

My humidity is always ick.

In the climate I live in, the average humidity is never below 60, so my humidity tolerance is a little different. :)

A nice enhancement would be for the ick threshold to either be a) configurable (quicker) or b) smart detected (more awesome).

Thanks for this! It's really nice.

cannot unmarshal bool into Go value of type string

I hate to be this person, but I found another bug.

thomas@workstation:jspm-npm$ weather -l "Manhattan Beach, CA"
Decoding the response from https://geocode.jessfraz.com/forecast failed: json: cannot unmarshal bool into Go value of type string

Typo in code

Hi,
there is a typo on line 83 & 84, visibilty => visibility

Cool app, love it
tnx

weather doesn't follow redirects

Weather fails for me.

$ ./weather
Decoding the response from http://geocode.jessfraz.com/forecast failed: invalid character '<' looking for beginning of value

So I tcpdumpd to see what it was doing and reproduce it manually.

$ curl -D - -X POST -d '{"lat":XX.XXXX,"lng":-XX.XXXX,"units":"auto","exclude":["hourly","minutely"]}' http://geocode.jessfraz.com/forecast
HTTP/1.1 301 Moved Permanently
Date: Thu, 08 Jan 2015 23:36:33 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d4f28a5de551b9cc2c12fe45765a8efcb1420760193; expires=Fri, 08-Jan-16 23:36:33 GMT; path=/; domain=.jessfraz.com; HttpOnly
Location: https://geocode.jessfraz.com/forecast
Server: cloudflare-nginx
CF-RAY: 1a5c37cafff00da9-SJC

<html>
<head><title>301 Moved Permanently</title><script type="text/javascript">
...

Following redirects...

curl -L -X POST -d '{"lat":XX.XXXX,"lng":XX.XXXX,"units":"auto","exclude":["hourly","minutely"]}' http://geocode.jessfraz.com/forecast  
{"error":true,"message":"Latitude and longitude were not properly sent."}

which is another issue itself.

weather doesn't follow redirects

Weather fails for me.

$ ./weather
Decoding the response from http://geocode.jessfraz.com/forecast failed: invalid character '<' looking for beginning of value

So I tcpdumpd to see what it was doing and reproduce it manually.

$ curl -D - -X POST -d '{"lat":XX.XXXX,"lng":-XX.XXXX,"units":"auto","exclude":["hourly","minutely"]}' http://geocode.jessfraz.com/forecast
HTTP/1.1 301 Moved Permanently
Date: Thu, 08 Jan 2015 23:36:33 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d4f28a5de551b9cc2c12fe45765a8efcb1420760193; expires=Fri, 08-Jan-16 23:36:33 GMT; path=/; domain=.jessfraz.com; HttpOnly
Location: https://geocode.jessfraz.com/forecast
Server: cloudflare-nginx
CF-RAY: 1a5c37cafff00da9-SJC

<html>
<head><title>301 Moved Permanently</title><script type="text/javascript">
...

Following redirects...

curl -L -X POST -d '{"lat":XX.XXXX,"lng":XX.XXXX,"units":"auto","exclude":["hourly","minutely"]}' http://geocode.jessfraz.com/forecast  
{"error":true,"message":"Latitude and longitude were not properly sent."}

which is another issue itself.

Error 403

Hello, this is the error message I'm getting both on brew (macOs Big Sur) and Raspberry Pi:
http request to https://geocode.jessfraz.com/forecast failed with status code: 403
Any suggestions???

SSL Cert Expired?

Tried to run and got this error -

Get https://telize.j3ss.co/geoip: x509: certificate has expired or is not yet valid

Sorrrryyyy :(

Forecast response failed

Getting Decoding forecast response failed: invalid character 'd' looking for beginning of value message.
running:
go version go1.11.4 darwin/amd64
weather:
version : v0.15.6

had this error a few days ago, updated go version and it started to work. This morning was a different story.

No version/build output in Go installs

was using your Makefiles as templates in a few projects (they're great by the way) and realized that custom ldflags don't get set in go get installs, so -version output has no version number or commit hash (also no \n):

$ weather -version
weather version , build $

Specifying location returns REQUEST_DENIED from Google Geocode API

I'm having an issue with the --location option:

$ weather -l "Chicago, Illinois"
Geocode API response error: Google Geocode API response error: REQUEST_DENIED - You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started

Automatic IP geocoding (i.e., running the program with no arguments) works fine.

Version info:

$ weather version
weather:
 version     : v0.15.7
 git hash    : homebrew
 go version  : go1.13.4
 go compiler : gc
 platform    : darwin/amd64

Display dewpoint?

Not sure if it's an option, but showing the dewpoint would be useful. Relative humidity doesn't actually tell you much about how "icky" it feels - the dewpoint is the true indicator of that (it's possible for the RH to be very high but if the dewpoint temp is low, it won't feel like a swamp).

I have nearly zero coding skill or else I'd try to make a PR. ;)

Decoding forecast response failed: invalid character 'F'

Hi, it looks like this issue is on the rise again.

I am using weather from source with $ go get github.com/jessfraz/weather.

$ weather
Decoding forecast response failed: invalid character 'F' looking for beginning of value

I wonder what's causing this now?

Forecast option is confusing?

image

Hey Jess, not sure if it's really an issue but I would have expected to see the forecast for Saturday and Sunday when sending -d 2 as getting the same info twice (Friday) is irrelevant for me.

If you think this should be changed I'm glad to submit a PR, I just wanted to check with you first.

Thanks for the amazing tool!

Option to remove weather icon, make smaller.

I really like this CLI Weather script. I like how informative it is and even includes weather alert. It would be nice to have an option to remove/add weather graphic, and/or make it smaller. I use i3 and most windows are tiled in a way that the graphic takes up most the screen.

Just thought of another idea, could also but the txt and graphic side by side which would be much better and use up more of the empty space.

Why are the icons hosted?

Why are the ASCII icons hosted on an S3 bucket, as opposed to being stored locally? I feel bad that you are charged for our usage.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.