Mike Kreuzer


Twitter followers

22 January 2017

I stumbled across some blog posts with Ruby and Python code to find the people you'd followed on Twitter, who weren't following you back. Inspired by those I decided to re-write them in Elixir.

Using the Extwitter library, in Elixir the meat of the code is:

username = "mikekreuzer"
following = ExTwitter.friend_ids(username)
followers = ExTwitter.follower_ids(username)
guilty = following.items -- followers.items
Enum.each(guilty, fn(id) ->
                    user = ExTwitter.user(id, include_entities: false)
                    IO.puts "#{user.screen_name}, #{user.followers_count} followers"

You get a lot for free with mix, iex and the scaffolding that sits around your Elixir code. You also have to remember that what would ordinarily be the decrement operator in any other language is used here to subtract one list from another one, rather than a simple minus operator being overloaded (for some reason).

Toy examples of code like this aside, the main pain point of the language remains its lack of 3rd party libraries. There are occasional weird rough edges to the language itself, like the -- operator here, but for everything from dates & times to payment gateways, its the lack of libraries that's the killer.

On a more positive note, I've finally moved the hosting of this blog to a new server where I can finally (finally!) auto-renew my Let's Encrypt certificates & go https only, as well as play with things like Elixir in the real world.

Earlier Posts

Six months with Elixir

11 September 2016

Back in January I sat down and had a play with Elixir. By the end of February I'd decided this could be the one. I've waxed and waned on that, as one does with a new language, but it's just a little longer than six months now and here I am, all in. This is why.

Read more…

Ripley - now with added Elixir

21 August 2016

I've been scraping reddit programming languages subreddits since April, ranking them by number of subscribers, and the results are up on the Ripley site. This morning I rewrote the scraper that generates that data in Elixir; originally I'd written it in Go.

Read more…

WWDC 2016 Hardware

7 July 2016

Three weeks after WWDC & I still feel disappointed it was a software only event this year - despite that idea being telegraphed pretty openly via some of the usual sources.

Read more…

JSON: a lowest common denominator too far

10 April 2016

JSON, much like its ancestral home JavaScript, is both horrible and ubiquitous. So because serializing an array of structs to JSON and writing that output to a file either in compact form or pretty-printed is something I do all the time, looking at how different languages handle that task is one way to see how easy the different languages are to work with day to day, as well as perhaps giving something of an insight into their philosophies & communities.

Read more…

Ripley: reddit programming languages index

31 March 2016

Introducing Ripley: reddit programming languages index - the index ranks programming language subreddits by number of subscribers. Ripley, from RPLI.

Read more…

Elixir - Drinking the Kool-Aid

29 February 2016

For the last few Januarys I've taken some time off from the day to day stuff to look a bit further afield, to do something new, code something in a language I've never used before, & have some fun. Sometimes something comes of it -- the static site engine that powers this blog was a January Project -- sometimes it's just ruling something out; but it's always useful, & a practice I can highly recommend to keep jadedness at bay.

Read more…

Or read even earlier posts…