Live data from Hacker News

A command-line weather app built using Elixir

github.com

41–50 of 67 posts

Re: A command-line weather app built using Elixir

#41
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 __ _ _ ___ _____ /_ || || | |__ \ | ____| | || || |_ ) || |__ | ||__ _| / / |___ \ | | | | _ / /_ ___) | |_| |_|(_)|____||____/

Perhaps I'm a bash noob, but when I try to paste that in my shell, it complains about a syntax error near `{curl`. Am I doing something wrong?

Re: A command-line weather app built using Elixir

#44
post #41
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 __ _ _ ___ _____ /_ || || | |__ \ | ____| | || || |_ ) || |__ | ||__ _| / / |___ \ | | | | _ / /_ ___) | |_| |_|(_)|____||____/

Perhaps I'm a bash noob, but when I try to paste that in my shell, it complains about a syntax error near `{curl`. Am I doing something wrong?

There are spacing issues for me. Try

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

Re: A command-line weather app built using Elixir

#45
post #15
post #11

Earlier quoted context omitted.

Because he's sharing the source code rather than a compiled binary. It's no different to having make + gcc listed as a dependency for C++ code.

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 (or those who want source) can clone the git repo.

Re: A command-line weather app built using Elixir

#46

Does not work (osx): ~/tmp/elixir-weather $ ./weather Amsterdam =INFO REPORT==== 7-May-2015::16:37:56 === application: elixir exited: {bad_return, {{elixir,start,[normal,[]]}, {'EXIT', {{badmatch,{error,enotsup}}, [{elixir,start,2,[{file,"src/elixir.erl"},{line,34}]}, {application_master,start_it_old,4, [{file,"application_master.erl"},{line,272}]}]}}}} type: temporary Failed to start Elixir. error: {error, {elixir,…

I will look into this issue. Thanks for reporting :)

Re: A command-line weather app built using Elixir

#47
post #19

curl ' http://api.openweathermap.org/data/2.5/weather?q=london&mode... &>/dev/null | jgrep -s main.temp | figlet Put this in a function. Done. Gist here since copying and pasting above didn't work. https://gist.github.com/zaargy/384889cb44960e8559d5

That's a good one!

Re: A command-line weather app built using Elixir

#48

I'm going to be honest... This is an ugly looking pig of a command line tool. The giant ascii art looks bad and does nothing for its usefulness or usability.

I am sorry for that. It was a hobby project of mine when learning Elixir and I got excited about it.

Re: A command-line weather app built using Elixir

#49
post #40

I'm sorry if this comes across as negative, but this is an example of using the wrong tool for the job, IMO. I love Erlang and Elixir because BEAM gives me easy concurrency, metaprogramming and best of all, fault tolerance via supervisors. For a service that I need to stay alive, this is great. For a simple command line utility, I'd lean more toward a compiled language like Go, Haskell, Common Lisp, etc.

I completely understand your point. This is a project I created while learning Elixir.

Re: A command-line weather app built using Elixir

#50

I'm going to be honest... This is an ugly looking pig of a command line tool. The giant ascii art looks bad and does nothing for its usefulness or usability.

I am sorry for that. It was a hobby project of mine when learning Elixir and I got excited about it.

I've got nothing against it. it's a fun little hobby app, but yeah, I've got to agree with the commenter above this is FAR from any standard definition of a "beautiful" app.
Post reply on HN