{"id":95,"date":"2015-10-12T22:13:44","date_gmt":"2015-10-12T22:13:44","guid":{"rendered":"http:\/\/joelherber.com\/?p=95"},"modified":"2019-12-27T16:05:37","modified_gmt":"2019-12-27T16:05:37","slug":"mr-penguin","status":"publish","type":"post","link":"https:\/\/joelherber.com\/?p=95","title":{"rendered":"Mr Penguin &#8211; A twitter controlled bubble robot"},"content":{"rendered":"<p>For the last couple of lunchtimes\u00a0I have been working with my technical director Alan to create a bubble machine that could respond to our social media presence.<br \/>\nMeet Mr P<\/p>\n<p><a href=\"http:\/\/www.joelherber.com\/wp-content\/uploads\/2015\/10\/DSC_0463-1.jpg\"><img loading=\"lazy\" class=\"alignnone size-large wp-image-96\" src=\"http:\/\/www.joelherber.com\/wp-content\/uploads\/2015\/10\/DSC_0463-1-714x1024.jpg\" alt=\"Mr p\" width=\"615\" height=\"882\" \/><\/a><\/p>\n<p>We brought a kids bubble machine for a <a href=\"http:\/\/direct.asda.com\/Munchkin-Bath-Fun-Bubble-Blower\/002679959,default,pd.html&amp;cmpid=ppc-_-ad-pla-_-ggle-pla-_-Toys-and-Games-_-002679959&amp;cm_mmc=ad-ppc-_-ggle-pla-_-Toys-and-Games-_-002679959&amp;istCompanyId=71f4ae42-94c5-4821-aa58-05eff6da2486&amp;istItemId=qpmrtqmq&amp;istBid=tztx&amp;cmpid=ppc-_-ad-_--_--_-&amp;cm_mmc=ad-ppc-_-ggle-pla-_-%5Basda%2Btracking%2Bcategory%5D-_-\">couple of quid<\/a>\u00a0and modified the switch on top so it was linked by a transistor. This transistor was then enabled and disabled by the GPIO socket on a Raspberry Pi, which we then switched on and off using a simple node.js program.<\/p>\n<p><a href=\"http:\/\/www.joelherber.com\/wp-content\/uploads\/2015\/10\/IMG_20151005_133209.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-98\" src=\"http:\/\/www.joelherber.com\/wp-content\/uploads\/2015\/10\/IMG_20151005_133209.jpg\" alt=\"IMG_20151005_133209\" width=\"581\" height=\"775\" \/><\/a><\/p>\n<p>The Twitter API has two REST callbacks which are were helpful for us to\u00a0respond to our presence.<\/p>\n<p>Firstly, <a href=\"https:\/\/dev.twitter.com\/rest\/reference\/get\/statuses\/retweets_of_me\">one call to get the all the retweets of the logged in user<br \/>\n<\/a>Secondly, <a href=\"https:\/\/dev.twitter.com\/rest\/reference\/get\/followers\/ids\">one call to get the list of followers<\/a><\/p>\n<p>I wrote the program to poll these callbacks every minute and to detect any changes.<\/p>\n<p>Lastly, the program also posts to our company Slack channel, detailing what Mr P is excited about.<\/p>\n<p><a href=\"http:\/\/www.joelherber.com\/wp-content\/uploads\/2015\/10\/Screen-Shot-2015-10-12-at-11.53.41.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-99\" src=\"http:\/\/www.joelherber.com\/wp-content\/uploads\/2015\/10\/Screen-Shot-2015-10-12-at-11.53.41.png\" alt=\"Screen Shot 2015-10-12 at 11.53.41\" width=\"579\" height=\"156\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/github.com\/Madhotdog\/mr-penguin-social-bubbler\/blob\/master\/twitterPenguin.js\">Here&#8217;s a copy of the source code<\/a> and here&#8217;s a video of the little guy in action.<\/p>\n<p><iframe loading=\"lazy\" width=\"440\" height=\"248\" src=\"https:\/\/www.youtube.com\/embed\/bI6bM1kO3Uw?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the last couple of lunchtimes\u00a0I have been working with my technical director Alan to create a bubble machine that could respond to our social media presence. Meet Mr P We brought a kids bubble machine for a couple of quid\u00a0and modified the switch on top so it was linked by a transistor. This transistor&#8230; <\/p>\n<p class=\"more\"><a class=\"more-link\" href=\"https:\/\/joelherber.com\/?p=95\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":603,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/posts\/95"}],"collection":[{"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joelherber.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=95"}],"version-history":[{"count":1,"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":728,"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/posts\/95\/revisions\/728"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/joelherber.com\/index.php?rest_route=\/wp\/v2\/media\/603"}],"wp:attachment":[{"href":"https:\/\/joelherber.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joelherber.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joelherber.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}