Live data from Hacker News

A command-line weather app built using Elixir

github.com

61–67 of 67 posts

Re: A command-line weather app built using Elixir

#62
post #37

Ya know, I was just thinking about doing something like this just a couple of days ago, but instead I wrote a python script to get the weather from forecast.io api, then brought that into my tmux status bar.

That's great! would be nice if yo could share the source as well.

Ask and you shall receive! I'm very much a beginner developer so any feedback would be appreciated.

https://gist.github.com/jhwhite/2df093eff1f9bab74144

Re: A command-line weather app built using Elixir

#63
post #27

function weather(){curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=metric" | jq .main.temp | figlet -kcf big} $ weather london __ _ _ ___ _____ /_ || || | |__ \ | ____| | || || |_ ) || |__ | ||__ _| / / |___ \ | | | | _ / /_ ___) | |_| |_|(_)|____||____/

Cool! for fahrenheit you can change the units to imperial

  function weather(){curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=imperial" | jq .main.temp | figlet -kcf big}

Re: A command-line weather app built using Elixir

#64
post #9

Earlier quoted context omitted.

This is much much better. Closer to "beautiful" than the one featured here.

Yeah, it's beautiful if 1) you think mutable variables are beautiful 2) you think stuffing everything into one file is beautiful 3) you think defining functions at the root namespace is beautiful 4) you think consecutive repeated property accesses stuffed into a consecutively repeating boolean check like this are beautiful: if h.Time == "0" || h.Time == "100" || h.Time == "200" || h.Time == "300" || h.Time == "400" |…

I think the parent was referring to the console display output rather than the code itself.

Re: A command-line weather app built using Elixir

#65

Earlier quoted context omitted.

Yeah, it's beautiful if 1) you think mutable variables are beautiful 2) you think stuffing everything into one file is beautiful 3) you think defining functions at the root namespace is beautiful 4) you think consecutive repeated property accesses stuffed into a consecutively repeating boolean check like this are beautiful: if h.Time == "0" || h.Time == "100" || h.Time == "200" || h.Time == "300" || h.Time == "400" |…

I think the parent was referring to the console display output rather than the code itself.

lol. then I guess I will step off my pedestal and agree. I mean... I think Figlet does a better job than all of these, but anyway

Re: A command-line weather app built using Elixir

#66
post #45
post #15

Earlier quoted context omitted.

Strictly there is a little hindrance for the non-gopher user because this won't work until they set up a Go workspace, i.e. decided where they want GOPATH to be, set that, and added $GOPATH/bin to PATH to have the executable be runnable. $ env -i $(which go) get github.com/schachmat/wego package github.com/schachmat/wego: cannot download, $GOPATH not set. For more details see: go help gopath

Absolutely. I'm happy to `apt-get install` something, but the conceptual overhead of "let me configure a $language development environment" is high enough that I'm not going to bother just to install this awesome looking tool. I'd love it if this had been packaged in a way similar to Python or Node tools, where installation is as simple as 'install Python and pip; pip install my-program', and more-experienced users (…

So request a binary then. You're basically moaning that an open source project is shipping source code.

And FYI, Go is in quite a few distro repos so you might be able to just:

  apt-get install go-lang
  mkdir -p ~/go/src ~go/bin
  export GOPATH=~/go
  go get github.com/schachmat/wego
  go install github.com/schachmat/wego
However considering this is an open source CLI tool, I don't think it's at all unreasonable to expect he user to do a bit more manual work to compile and run this tool from the command line.

In fact, quite frankly, I find it rather disgusting that someone should share their work and source code like this and have others moan simply because they're too bloody lazy to compile it themselves. I mean seriously guys, this is Hacker News, not PC World Magazine.

Re: A command-line weather app built using Elixir

#67
post #45
post #15

Earlier quoted context omitted.

Strictly there is a little hindrance for the non-gopher user because this won't work until they set up a Go workspace, i.e. decided where they want GOPATH to be, set that, and added $GOPATH/bin to PATH to have the executable be runnable. $ env -i $(which go) get github.com/schachmat/wego package github.com/schachmat/wego: cannot download, $GOPATH not set. For more details see: go help gopath

Absolutely. I'm happy to `apt-get install` something, but the conceptual overhead of "let me configure a $language development environment" is high enough that I'm not going to bother just to install this awesome looking tool. I'd love it if this had been packaged in a way similar to Python or Node tools, where installation is as simple as 'install Python and pip; pip install my-program', and more-experienced users (…

It actually does work this way. 'Install Go; go get github.com/me/my-program'. Done.
Post reply on HN