[dev] wego: a weather app for the terminal written in go

1 view
Skip to first unread message

Markus Teich

unread,
Jan 14, 2015, 4:41:30 PM1/14/15
to Suckless Development
Heyho,

since I was tired of fetching lots of unneeded html and js and images just to
get a weather forecast, I wrote wego[0]. Comments welcome.

--Markus

0: https://github.com/schachmat/wego

Pascal Wittmann

unread,
Jan 14, 2015, 5:32:13 PM1/14/15
to d...@suckless.org
Hi Markus,

On 01/14/2015 10:42 PM, Markus Teich wrote:
> since I was tired of fetching lots of unneeded html and js and images just to
> get a weather forecast, I wrote wego[0]. Comments welcome.

Looks great! I will give it a try in the next few days.

Pascal

signature.asc

Nick

unread,
Jan 14, 2015, 7:53:37 PM1/14/15
to Suckless Development
Quoth Markus Teich:
> since I was tired of fetching lots of unneeded html and js and images just to
> get a weather forecast, I wrote wego[0]. Comments welcome.

I did a similar thing a while ago in bourne shell. It's fragile, as
shell scripts should be, and shouldn't be relied upon. But it's a
nice example of another way to do this. It was never written for
public use, but what the hell.

It uses Weather Underground, which means it has hourly info, and
lots of other forecast stuff that the script is just ignoring for
now. It also loads the json with the weather data without needing an
API key, because that shit is for chumps.

Oh, and its output is far, far more basic than Markus'.

Attached.
weather

Nick

unread,
Jan 14, 2015, 8:02:24 PM1/14/15
to dev mail list
Quoth Nick:
> I did a similar thing a while ago in bourne shell.

I forgot to mention it depends on curl and jq. Any bourne shell
should work though; I don't believe in bash.

Markus Teich

unread,
Jan 14, 2015, 9:06:57 PM1/14/15
to d...@suckless.org
Nick wrote:
> Oh, and its output is far, far more basic than Markus'.

Oh yes, one third of my SLOC are the ascii icons and nearly another third is for
the output formatting… :/

--Markus

Markus Teich

unread,
Jan 14, 2015, 9:15:39 PM1/14/15
to d...@suckless.org
Nick wrote:
> It uses Weather Underground, which means it has hourly info, and lots of other
> forecast stuff that the script is just ignoring for now. It also loads the
> json with the weather data without needing an API key, because that shit is
> for chumps.

For me, SSL support was more important than not having to use an API key. I did
not find a service providing both.

--Markus

Markus Wichmann

unread,
Jan 15, 2015, 12:26:54 AM1/15/15
to dev mail list
On Wed, Jan 14, 2015 at 10:42:07PM +0100, Markus Teich wrote:
> Heyho,
>
> since I was tired of fetching lots of unneeded html and js and images just to
> get a weather forecast, I wrote wego[0]. Comments welcome.
>

When I tried to run it, it would just print "Malformed response". I
added a line to dump the URL to stderr before that and tried to get it
with wget, and the response I get is 403 Forbidden. What am I doing
wrong?

Ciao,
Markus

Nick

unread,
Jan 15, 2015, 6:18:14 AM1/15/15
to dev mail list
Quoth Markus Teich:
Oh, I didn't notice it had SSL support, that's nice. You could look
into grabbing the data however the web frontend does (in my script
that involves grabbing a randomly generated key from an HTML page to
use in the json request). Though if it does things server side that
would mean you might just have to parse HTML, which is never ideal.

Markus Teich

unread,
Jan 15, 2015, 6:33:32 AM1/15/15
to d...@suckless.org
Markus Wichmann wrote:
> When I tried to run it, it would just print "Malformed response". I added a
> line to dump the URL to stderr before that and tried to get it with wget, and
> the response I get is 403 Forbidden. What am I doing wrong?

Did you read the setup section[0] in the README? You have to get an API key
first (it's free, you only need a github account) and put it into your ~/.wegorc

--Markus

0: http://www.worldweatheronline.com/api/docs/local-city-town-weather-api.aspx

Reply all
Reply to author
Forward
0 new messages