My family uses Slack. It’s pretty interesting.

Everything changed for the better when we started using slack at work. We’ve made countless custom integrations; doorbells, intercoms, travel cards, reddit, lunch menues, git hooks, server monitoring, you name it – we haz it.

My family has been using Google Calendar for a few years. Me and my wife used to think that we we’re busy every night and that there was no room for improvisation. Google Calendar showed us that we had lots of free evenings and weekends, which has been great.

When it was time to evaluate a group chat app, I saw no reason to use HipChat, Skype or anything like that. Slack to the rescue!

Slack’s free tier gives us 10 integrations, search for the latest 10 000 messages and 5GB storage. This is plenty for a family of 4. In this blog post I’ll go through how we use it and the integrations we have made to aid us.

Screen Shot 2016-02-01 at 15.15.44

We use channels just the same way we use them at work. “fixahuset” is a channel for stuff that needs to be fixed around the house, “general” is important stuff, “handla” is for picking up milk on the way home, “mathem” is an integration i’ll get to in a bit, and “random” is the usual cat gif mayhem we’ve all learned to love/hate. “pedertest” is where i test new integrations.

Integration no 1: Where are the kids?

We, as most parents to 10yo kids, ask this question daily. Picking them up at school, but they’re at a friend’s house, etc. Gah. This is a custom Slackbot command, which calls out to my server and returns the result.

My server runs a little curl script that calls out to Find My iPhone and returns a static GoogleMap image. The kids will probably start to question this thingie eventually, but works for now.


Integration no 2: Google Calendar

Our old Google Calendar integrates very smoothly, just hook it up and let Slack know when you want the notifications.

Screen Shot 2016-02-01 at 15.27.16

Integration no 3: School information

It turns out our school is living in the future, providing a RSS-feed per child. I had no idea. RSS works very well with this setup.

Screen Shot 2016-02-01 at 15.32.12

Integration no 4: Online food shopping

In Sweden, MatHem is one of the biggest e-commerce sites for groceries. We use them for a weekly delivery, and it works great. The night before delivery we generally take 10 minutes and cram everything we can come up with into our cart, which means that we miss a lot of essentials. What if we could add uhm… juice to our cart throughout the week, the moment when someone realise that we’re out of uhm… juice (“sök” means search, “köp” means buy).


This integration is not kosher at all, and I’m probably breaking some terms and conditions. But we need this, and it could be done, so hey. If you work at MatHem or is offended by this in any way – please let me know and I’ll cease and desist.

That’s all the stuff we’ve got now, but more to come. Applying tactics from work to family life may seem cold, but I see this as a way to make the most out of our time. It’s not like we’re writing Jira stories or planning our vacation in Trello. Yet.


Lots of people wrote and talked about this, like, ForbesNyTeknik (Swedish) and Apparat (Russian). And on Twitter (1) (2) (3) (4), Hackernews and CBC Spark also made an interview, which was great fun.

Syncing your Korg Littlebits to external trig

Syncing your Korg Littlebits sequencer can be a bit tricky unless you have the official break-out bits, or a SQ1 sequencer too hook it up to. I multimetered the cables between the breakout bits:

Red = DC current.
Orange = trig.
White = ground.

Turns out the kit actually speaks normal trig signal, and the internal trig is about the same as the trig from a drum machine (in this case a Boss DR110). So we cut the orange and white cables going into the sequencer and joined these the wires from a cut mini jack cable. Voilá – external trig!



Self-generating recursive art using Amazon Mechanical Turk

Amazon Mechanical Turk is an amazing API. It’s an API to humans, and yup that sounds super weird.

I programmatically create a HIT – a Human Intelligence Task, using their API. Typical HIT’s are “sort these files by cuteness”, “listen to these audio files for NSFW material” and other things a computer can’t do well (yet). Humans somewhere in the world will choose to do these tasks and get micro payments in return. We’ve got more posts about this coming up soon.

I wanted to see what happens when this system starts playing by itself, essentially by creating a feedback loop where a result from a HIT yields a new HIT, in an eternal loop. The outcome… is it art? A blog-series? A study in low-wage work? Who knows.

The task I created was to interpret the text phrase “I was born on Jupiter” into a 20 seconds video of containing dance. The next task will be to interpret the modern dance in a drawing. The one after that is to interpret the drawing in a text, and then it starts over.

Everything is documented on Humans are slow, so it could take days for new posts to turn up here. I’ll keep it going as long as it’s interesting.


Making a silly game using Google Cloud Vision and Instagram

I was recently invited to the first alpha release of Google Cloud Vision, which is a game changing new API from Google. I can programmatically upload any picture and get this kind of stuff back:

  • Face detection, with pixel annotations of the corner of the mouth etc, plus unexpected values like sorrowLikelihood
  • Landmark detection, with LatLon polygon boundaries to real world landmarks
  • Logo detection
  • Text detection
  • Safe search detection, which can detect medical, nude and violent content

I wanted to dig right in, and decided to build a really silly little game. I call it Game Of Cats, and has nothing to do with Game of Thrones at all.

A user logs in using their Instagram credentials. My game engine starts polling all recent pictures from the people the user follows, and awards a point for every cat picture that occurs. The game goes on forever, without any interaction.

Screenshot 2015-12-08 22.35.28

I won’t bore you with details about how Instagram handles OAUTH, but you might be interested in how Google Cloud Vision wants to talk to an app like this? I built this quick and dirty as it should be, in PHP.

I would love to have the energy to build a WordPress plugin that adds a taxonomy to the media library, and automatically tags all uploaded images using Google Cloud Vision, but I don’t. Someone else will, and they write better code than I do anyway.


Note: I can’t post the URL to the actual game, yet. The alpha’s terms and conditions prohibits me from deploying to production.


Here is a list of WordPress plugins that Sweden’s largest political parties use

TL;DR: We made a website:

WordPress is pretty big here in Sweden. Recently we found out that six of the largest political parties use WordPress on their main sites.

Here at Earth People we also use WordPress to build sites, so we thought that this it was a pretty cool and interesting fact that all these parties used WordPress too.

But wouldn’t it be interesting to know what plugins they use on their websites? Yeah, we thought so, so we built a website with this information: (only in Swedish for now, sorry!).

Just for the fun of it we also checked what CMS the sites who did not use WordPress used, and what web server software they were using. And we did a check of their PageSpeed score. AND we put all the code on GitHub, so people could contribute to the website.

Mandatory reading for PHP devs

I just wanted to give this site I stumbled upon some credit: I’ve been developing with PHP for about 15 years, but still the part about performance taught me quite a lot. isset() is apparently faster than array_key_exists() and $i++is slow compared to ++$i. These are micro-optimizations, sure, but there’s no reason to rub PHP the wrong way…


Finding out sentiment

Say you want to find out if a user generated text is happy, sad, upbeat or hateful. Not so easy is it? We were given this task as a part of a recent project. And to make things even more challenging we needed to do this in both Swedish and English.

After a bit of research I found a very interesting API that pretty much does this – SAPLO. Using their API we can create reference groups of texts, and compare user generated texts with these groups.

Say we create two groups; Positive and Negative.
We then measure each user generated text towards these groups, and get a sentiment back. For instance:

Jag har tråkigt (I’m bored):
[Negative] => 0.14
[Positive] => 0

Fisk är gott (Fish tastes good):
[Negative] => 0.22
[Positive] => 0.28

Många tycker det är tråkigt att resa, men inte jag (Many people things that it’s tedious to travel, but I don’t):
[Negative] => 0.40
[Positive] => 0.46

SAPLO works great on both English and Swedish.

NFC + Krautmilen + Android


We needed to make something to measure timings during the running event Krautmilen.


  1. Make a fugly Android app which could relay runners NFC keyring blips to a server API.
  2. Make a server API to handle the basic running logic (ie pair up names of runners with their start and finish times)

The application is quite simple: once the NFC tag has been blipped it sends an Intent to the application that contains the NDEF data. We grab the ID from the NDEF and perform a HTTP request to the server API.

Since the Android app basically just relays on sending NFC tag IDs to a server, there are lots of use cases, so we released it on Google Play yey! You can enter your own URL, make HTTP requests and use the data to whatever you want. NFC is everywhere nowdays; in travelcards, passports, library books and much more.

Here’s a small code example for handling the Intent:

private void handleIntent(Intent intent) {
      String action = intent.getAction();

      if(NfcAdapter.ACTION_TAG_DISCOVERED.equals(action) || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {

            NdefMessage[] messages;
            Parcelable tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);

The only boring thing is that the Android device needs to be unlocked, because the device turns off the NFC chip when it is asleep. This is quite annoying but due to safety reasons it makes sense. You can go around that though, but you will have to root your Android device.



Hooking up the voice intercom to Slack

The intercom from the street to our office was connected to an old GSM phone, and letting people in required us to pick up the phone and press the digit 5. Simple, sure, but it doesn’t feel like 2015. I had also been meaning to try the Twilio API for some time.

Task: Connect the Intercom to Slack.

The Twilio API is great, so it was actually really easy to accomplish. I bought a local number and asked our landlord to forward the Intercom to it. Then I set up this simple TwiML script on a web server:

  <Say>Welcome to Earth People. Please stand by.</Say>
  <Enqueue waitUrl=""> </Enqueue>

What happens here is that Twilio will pick up the call and greet the intercom user using Twilio’s text to speech service. It will then put the “call” into a new phone queue. Twilio will generate a phone queue id and pass it via POST to the waitUrl, below:

header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
file_put_contents('input_porttelefon.txt', $_POST['QueueSid']);
# curl post to slack
$data = array(
  "channel" => "#general",
  "username" => "Intercom",
  "text" => "Meep Meep! Open the door with 'Intercom'",
  "icon_emoji" => ":door:"
$url_send = "";
$str_data = json_encode($data);
$ch = curl_init($url_send);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str_data);

The waitUrl will save the phone queue id to a text file, make an incoming webhook to Slack and of course play a funky tune to the intercom user. Now Twilio will play the funky tune until it ends, or an incoming HTTP-request is made to the Twilio REST API, using the queue id.

Slack is set up to make an outgoing webhook to a URL. This URL just pops the only call in the queue to the front of the queue.

# when incoming hook: read call sid from file and call twilio.
$QueueSid = file_get_contents('input_porttelefon.txt');
  $sid = "xxx";
  $token = "xxx";
  $client = new Services_Twilio($sid, $token);
  $member = $client->account->queues->get($QueueSid)->members->get("Front");
    "Url" => "",
    "Method" => "GET"
  file_put_contents('input_porttelefon.txt', '');
  echo '{"text": "Ok, opened."}';
  echo '{"text": "No one is at the door."}';

The last step is to have Twilio play the sound of the digit 5, which opens the door, using the same kind of XML as step 1. Easy!

Next up is to let intercom users, which we don’t let in for some reason, leave a voice message which is posted to Slack. Totally doable, but not we’re quite there yet.