I snart tio år har Earth People skapat och utvecklat verktyg för att hjälpa tjänster att prata med varandra. Ofta utan att tjänsterna egentligen stöder detta. Vi har byggt feta amerikanska bilkampanjer med konversationsteknik, reverse-engineerat Snapchat’s API till Europas första SnapChat-kampanj, hackat ihop det enda rimliga sättet att hitta bra band på SXSW, typ kopplat ihop MatHem med FindMyIphone och fått en hel del världspress på köpet.
Precis just nu pågår ett skifte, i vilket fler och fler tjänster bjuder in till utveckling av chattbottar. Det är via denna kanal som många kunder kommer att interagera med tjänster och varumärken eftersom användare har slutat installera nya appar. Tjänster som Kik, WeChat, Telegram och Slack leder denna bottrevolution, och nu när bottarna kommer till Facebook Messenger och Skype tror vi och många andra att detta kommer att explodera. Med detta som utgångspunkt startar vi nu en systerbyrå – Botanical.
Earth People lever kvar som vanligt och fortsätter göra internet en bättre plats för våra kunders kunder. Men vill du ha en bott – prata med Botanical.
We needed(?) a REST API to our coffee machine. So I put a Twine next to it, and made it call back over HTTP to a webhook on one of our servers. This webhook logs all the temperature changes, and now anyone can query the dataset via our REST API. It just returns if the coffee is hot or cold in beautiful JSON.
Then, just for the hell of it, I set up an API to our teapot too.
(It actually only returns that it is a teapot, according to the HTCPCC. Which is probably abusing the meaning of the status code, since it’s in the 400 Bad Request-range…)
This is a game that’s perfect for a company event, like our own Helsinki kick off. You get a list with stuff that you’re supposed to capture with your smartphone camera, tag properly and upload to instagram. Some of them are bound to a place, some not. Hard task – more points. In the field you get to see the other teams’ progress, as well as your own, listed and on a map. You also get comments from the web app directly in your instagram feed, telling you if you got points or if the image is no good for some reason, wrong location for instance.
In the backend we have a database with teams, challenges and scores, and a web app connected to the instagram api. The app checks the participants’ feeds for tags included in the game, and compares the challenge geo data to the image location, considering a specified allowed offset in meters.
Our challenges would be something like “Eating a Panda liquorice ice cream in Esplanadin Puisto”. The team would then have to find out what and where Esplanadin Puisto is, try to get there, find a place that sells the particular Panda ice cream, and take the photo. Plus snap a picture of a mullet on the way.
A time frame factor could also be added to the game – “A woman walking into the Arabia Store between 12 and 12.15”
We can make this fun thing happen at your event too. While your staff get loads of fun and team building, your company gets lots of positive social media exposure. Everybody’s happy, for real.
i really, really despise stuff without a public api.
then i realized we don’t even have one ourselves. gah!
(i also realize that this is of little value to anyone, but i just couldn’t stand hating myself.)
earthpeople.se json api:
In our second experiment we’ve been playing around with the Instagram API. The basic idea was to create mosaic images from Instagram photos tagged with something we like, for instance #cats (internet is made of cats, anyway).
To begin with, we fetch a gazillion images with the tag in question. By resizing the images to 1 x 1 pixels, we get the dominant color of the photo. The RGB value along with a tiny copy of the photo is saved for later.
Instagram API also provides a real-time feature that lets you subscribe to updates, like users, tags etc. We registered a subscription for the tag #epmosaic. When there is a new photo with the tag #epmosaic, an update object is posted to our subscription callback url. In our callback method, we fetch the latest photo tagged as #epmosaic.
By resizing the photo to a suitable size and going through the color of each pixel in it, matching the color with the RGB values of the images in our database, we recreate the photo with our tiny images of cats!
Download the code, but keep in mind that it’s just an experiment so it’s not exactly robust or neatly structured.
the new earthpeople.se is an experiment driven website, where we try out ideas in the background, where the actual content stays the same over time. we just love fiddling around with www, and we thought it would be a good idea to showcase this somehow.
the base of the website is a codeigniter install, with all content living inside one reusable model. using routes we can decide when to go live with a new experiments, by routing to a new controller.
in the first experiment we’ve set up a webcam, which will move around from day to day. our music machine (my old macbook pro) has been rigged with a couple of scripts to enable twitter users to decide our playlist. the playlists are logged in mysql and displayed on the website.
some fun findings when creating these scripts were:
– you can control the local spotify client by calling “open <spotify uri>” from commandline (at least in osx).
– it’s easy to make your mac talk, from php. call “say <text to be spoken>” from within a system() call (we use this to make the mac read us whatever is playing next and who’s chosen it)
– spotify’s metadata api returns the duration of a song, which makes it easy to create a fake play queue from within php. the script playing songs is actually just an endless loop that sleep()’s the duration of the current song.
download the scripts here. bare in mind that these are just fun hacks and should maybe not be used in a production environment. oh wait…