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.

/Peder

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

 

EP Hashimage gets a speedboost

The last few days we have been working on improving the speed if our EP Hashimage plugin. Today, we have released the result, a plugin that loads 70-80% faster when loading from the cache.

This is achieved after a complete rewrite of the caching function. It now used the WordPress Transients API. As usual, you find the latest version over at WordPress.org plugin directory.

Select networks in EP Hashimage


Today we’ve added a new feature to our EP Hashimage WordPress plugin.
You can now (from version 3) choose which networks you want to include in your search for images with a specific hashtag.
For example –  if you want to print images tagged with #cat but only from the instagram network. That is now possible.

This has been on our todo list for a while, but since we only develop and maintain our plugins between projects it sometimes take a while before new features are added.

We hope you’ll find our plugin even more useful with this new feature.

As usual, download the plugin from the WordPress plugin directory, or update it via your plugin manager on your WordPress site.

EP Social Widget now with shortcode

Our very popular social widget plugin has been updated with shortcode support so that you with ease can display your social links in posts and pages. Here is a short how to.

[ep-social-widget facebook="https://facebook.com" gplus="https://plus.google.com" rss="1"]

Available networks are

  • facebook
  • gplus
  • twitter
  • flickr
  • youtube
  • rss

Just use the one you want to display in your post/page and give it a link. The RSS option only need a 1 as value if you want that displayed. Remove any network completely to remove it from the post/page.

Download it from the WordPress Plugin Directory.

Hashimage updated with async loading

From the start we always felt that we needed to do something about the slow loading of the hashimage plugin. Today we have updated it with the option to use async loading, letting all the heavy work to be done after initial page load. See the settings page for this new option.

In this update we have also integrated support for pic.twitter.com and images in the lightbox are no longer cropper and cut, say hallo to the whole image scaled down.

As usual, you find this amazing plugin in the WordPress Plugin Directory and please leave a comment if you have any suggestions or just like the plugin.

The new latest version is 2.3.0.

WordPress plugin for fetching hashtag images

Some time ago i made a quick and dirty site for displaying images from a certain Twitter hashtag. Some hours ago i was asked to tweak this into a WordPress plugin, and here we go. This is just tested on my environment, but should be alright on any WordPress 3+ installation on PHP5 with libcurl.

It currently works with twitpic, instagram, yfrog, plixi, flickr. Adding more services is quite easy and can be done on request. URL’s are being curled and cached for 10-12 minutes using the built-in WP_Cache.

The plugin, when enabled, exposes a template tag which you can add to your theme:

<?php
if(function_exists('hashimage')){
 echo '<ul>';
 echo hashimage('hashtag=unicorn&limit=5');
 echo '</ul>';
}
?>

I can’t be bothered add this to the official WordPress repo, but please download it (or fork it!):
https://github.com/EarthPeople/Hashimage-WP

Some notes:
– The Twitter API only returns the latest results when searching on hashtag, so the result set is limited due to this.
– CSS is up to you. Really. I can’t do CSS. It’s magic to me.

hashimage.com

some days ago, my wife attended some kind of social media event, called ssmx. during the event my twitter feed was packed with twitpics, yfrog and instagrams, and i decided to make a quick hack. here it is:

http://hashimage.com

the idea is simple – you just feed it a hashtag and it will scour the twitter api for images, extract them and present them to you. granted, some design would be awesome. if any fellow co-workers read this – feel free to take a stab at it (site is hosted on our usual box).

yey for hacks. out.