Redditex - First Exercise with Elixir

168 views
Skip to first unread message

Bill Christian

unread,
Aug 15, 2014, 4:57:58 PM8/15/14
to elixir-l...@googlegroups.com
My first attempt at building an application with Elixir.


I ported the Geddit tutorial example from Go to Elixir. Redditex pulls the most recent articles from Reddit for a given subreddit. Not extremely useful, but an educational exercise in learning and discovery. I used the excellent Programming Elixir book for learning and modeling the features, HTTPoison for simple HTTP access, and Poison for the JSON parsing. 

I had great fun and thought to share for other Elixir newbies like myself. Comments are constructive feedback appreciated. Very excited to continue with Elixir on my next code venture.

José Valim

unread,
Aug 15, 2014, 5:01:31 PM8/15/14
to elixir-l...@googlegroups.com
Really nice!

You should definitely give a try later at concurrently fetching subreddits.

It will be a fun learning exercise to try!



José Valim
Skype: jv.ptec
Founder and Lead Developer


--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bill Christian

unread,
Aug 15, 2014, 5:38:48 PM8/15/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
Actually, I was thinking the same to explore using Agents, Tasks, and OTP.

Thanks for the encouraging suggestion.

Bill Christian

unread,
Aug 18, 2014, 11:23:15 PM8/18/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
I completed a new version where the CLI fetches multiple subreddits concurrently using Task.async & await. Unsure if I should have pushed the asynchronous responsibility into the Client layer or not. Feedback on the design or code is appreciated.



On Friday, August 15, 2014 5:01:31 PM UTC-4, José Valim wrote:

Carlos Palhares

unread,
Aug 19, 2014, 10:03:41 AM8/19/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
Thanks for sharing this! I’m also learning Elixir and your code seem like a good read. I didn’t know the OptionParser til now and I absolutely loved the way you used (not sure if it’s just the standard, but who cares…).

-- 
Carlos Palhares
Sent with Sparrow

Bill Christian

unread,
Aug 19, 2014, 9:02:46 PM8/19/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
I would encourage you to get Dave Thomas' book Programming Elixir, currently in beta. It helped me tremendously along with the excellent Elixir Getting Started Guide and the community at large.
Reply all
Reply to author
Forward
0 new messages