{"id":9226,"date":"2016-03-23T18:00:11","date_gmt":"2016-03-23T15:00:11","guid":{"rendered":"http:\/\/blog.altoros.com\/?p=9226"},"modified":"2019-06-20T02:55:32","modified_gmt":"2019-06-19T23:55:32","slug":"using-the-bluemix-insights-for-twitter-service-with-a-rails-app","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/","title":{"rendered":"Using the Bluemix Insights for Twitter Service with a Rails App"},"content":{"rendered":"<p>The tutorial also provides sample code for a proof of concept.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#A_step-by-step_tutorial\" >A step-by-step tutorial<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#Related_reading\" >Related reading<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"A_step-by-step_tutorial\"><\/span>A step-by-step tutorial<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Today, I will show how to use one of the many services provided by Bluemix in a Rails application.<\/p>\n<p>It is a really easy process once you get the idea. Here is my <a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\" target=\"_blank\" rel=\"noopener noreferrer\">working code<\/a> at GitHub. Now, let\u2019s go through the main steps.<\/p>\n<ol>\n<li style=\"margin-bottom: 12px\">Create a Ruby web application from the Bluemix dashboard.<\/li>\n<li style=\"margin-bottom: 12px\">Create the Insights for Twitter service and bind it to your application.<\/li>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-twitter-insights-v1.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-twitter-insights-v1.png\" alt=\"ibm-bluemix-twitter-insights-v1\" width=\"640\" class=\"aligncenter size-full wp-image-9229\" \/><\/a><\/center><\/p>\n<li style=\"margin-bottom: 12px\">Click your application on the Bluemix dashboard, go to the <strong>Start Coding<\/strong> section, and follow the instructions for downloading your application.<\/li>\n<li style=\"margin-bottom: 12px\">Run <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">bundle install<\/code>.<\/li>\n<li style=\"margin-bottom: 12px\">\n<p>Install the Figaro gem following <a href=\"https:\/\/github.com\/laserlemon\/figaro\" target=\"_blank\" rel=\"noopener noreferrer\">these instructions<\/a> and add the necessary environment variables to the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">config\/application.yml<\/code> file.<\/p>\n<p>To find these variables, go to your application summary on the Bluemix dashboard and click <strong>Show Credentials<\/strong> on the Insights for Twitter service tile. Once there, the needed variables are the ones inside the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">credentials<\/code> key. All environment information related to services bound to your application is stored in the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">VCAP_SERVICES<\/code> environment variable.<\/p>\n<p>Here are these values in your Bluemix application console.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1.png\" alt=\"ibm-bluemix-insights-for-twitter-vcap_services-v1\" width=\"640\" class=\"aligncenter size-full wp-image-9230\" \/><\/a><\/center><\/p>\n<p>I added the variables required for connecting to the Insights for Twitter service, and here is my sample file <a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\/blob\/master\/config\/application.yml.sample\" target=\"_blank\" rel=\"noopener noreferrer\">application.yml.sample<\/a>. The variables from this file will be automatically set as environment variables. The file should be ignored by Git, but it will be uploaded to your Bluemix instance unless you create a <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.cfignore<\/code> file with the files and folders you don\u2019t want to be uploaded.<\/p>\n<p>If you don\u2019t want to use the file, you can configure the same environment variables inside the Bluemix user interface. For doing so, click your application tile, go to <strong>Environment Variables<\/strong> on the left navigation pane, and click <strong>USER-DEFINED<\/strong>.<\/p>\n<p>You will be able to access these variables with <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Figaro.env.key_name<\/code> or with <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">ENV[\"key_name\"]<\/code>.<\/p>\n<\/li>\n<li style=\"margin-bottom: 12px\">\n<p>Create a class for communicating with the Twitter service.<\/p>\n<p>I decided to create it inside the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">services<\/code> folder <a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\/blob\/master\/app\/services\/twitter_service.rb\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. Remember to add the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">services<\/code> folder to <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">application.rb<\/code> for autoloading it:<\/p>\n<pre style=\"padding-left: 30px;\">config.autoload_paths &lt;&lt; Rails.root.join(&#039;app\/services&#039;)<\/pre>\n<p><\/p>\n<p>Here is the code for the controller: <a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\/blob\/master\/app\/controllers\/searches_controller.rb\" target=\"_blank\" rel=\"noopener noreferrer\"><code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">searches_controller.rb<\/code><\/a>.<\/p>\n<\/li>\n<li style=\"margin-bottom: 12px\">\n<p>For the front end, use the example provided in the <a href=\"https:\/\/console.bluemix.net\/docs\/services\/Twitter\/index-gentopic1.html#genTopProcId2\" target=\"_blank\" rel=\"noopener noreferrer\">service documentation<\/a> and available at <a href=\"https:\/\/cdetestapp.mybluemix.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/cdetestapp.mybluemix.net\/<\/a>.<\/p>\n<p>You can download the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.html<\/code>, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.css<\/code>, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.js<\/code>, and image files with your browser or from the code I provide.<\/p>\n<p>Then, create a new controller (for example, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">SearchesController<\/code>), create an action inside it (for example, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">query<\/code>), its view (for example, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">query.html.erb<\/code>), and fill it in with the downloaded HTML.<\/p>\n<p>You can copy the images, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.css<\/code>, and <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.js<\/code> files to the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">assets<\/code> folder and include them properly in the view.<\/p>\n<p>Make that action the root of your application by changing <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">routes.rb<\/code>:<\/p>\n<pre style=\"padding-left: 30px;\">root :to =&gt; 'search#query'<\/pre>\n<\/li>\n<p><\/p>\n<li style=\"margin-bottom: 12px\">\n<p>Add another endpoint to <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">SearchesController<\/code> called <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">count_tweets<\/code> and the corresponding route.<\/p>\n<p>This endpoint will use our class service and return a JSON response. Using a class service is the suggested way of making requests. If you make them directly from the browser as in the example given, you will probably have problems with CORS, and you will be exposing sensitive information.<\/p>\n<p>Finally, you will need to change the URL used in the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">countTweets()<\/code> function inside the JavaScript file to work with our previously created endpoint (<code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">count_tweets<\/code>).<\/p>\n<p>You won\u2019t be able to use the URL helpers directly inside the JavaScript file, so you can define a JavaScript variable with that URL in your <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">html.erb<\/code> and then use it in the .js file.<\/p>\n<p>Here are the HTML and JS views:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\/blob\/master\/app\/views\/layouts\/application.html.erb\" target=\"_blank\" rel=\"noopener noreferrer\">views\/layouts\/application.html.erb<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\/blob\/master\/app\/views\/searches\/query.html.erb\" target=\"_blank\" rel=\"noopener noreferrer\">views\/searches\/query.html.erb<\/a><\/li>\n<li style=\"margin-bottom: 12px\"><a href=\"https:\/\/github.com\/brianfalah\/insights-for-twitter-poc\/blob\/master\/app\/assets\/javascripts\/search.js\" target=\"_blank\" rel=\"noopener noreferrer\">assets\/javascripts\/search.js<\/a><\/li>\n<\/ul>\n<p>Also, you could use the gem from <a href=\"https:\/\/github.com\/gazay\/gon\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/gazay\/gon<\/a> for solving the problem of sending Rails variables to JS files or whatever you want.<\/p>\n<\/li>\n<li>Run <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf push <em>app-name<\/em><\/code>.<\/li>\n<\/ol>\n<p>It should work!<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>I think there\u2019s no big difference between using a service provided by Bluemix and services from other vendors when what you are doing is a simple call to an API.<\/p>\n<p>As for me, the most important advantages of such services are the easiness of subscription, the fact that they provide you with credentials in an organized and standardized way, and a possible discount because of buying them from Bluemix.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Related_reading\"><\/span>Related reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/getting-started-with-ibm-bluemix-deploying-a-sample-ruby-sinatra-app\/\">Getting Started with IBM Bluemix: Deploying a Sample Ruby\/Sinatra App<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/continuous-integration-and-continuous-delivery-in-ibm-bluemix\/\">Continuous Integration and Continuous Delivery in IBM Bluemix<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/the-ibm-bluemix-object-storage-service-in-ruby-projects\/\">Using IBM Bluemix Object Storage in Ruby Projects<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/deploying-a-rails-app-with-elasticsearch-to-ibm-bluemix\/\">Deploying a Rails App with Elasticsearch to IBM Bluemix<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/demo-building-java-apps-with-bluemix-and-db2\/\">Building Java Apps with IBM Bluemix and DB2<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/how-to-connect-to-xpages-nosql-db-from-the-node-js-runtime-in-bluemix\/\">How to Connect to XPages NoSQL DB from the Node.js Runtime in Bluemix<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The tutorial also provides sample code for a proof of concept.<\/p>\n<p>&nbsp;<\/p>\n<p>A step-by-step tutorial<\/p>\n<p>Today, I will show how to use one of the many services provided by Bluemix in a Rails application.<\/p>\n<p>It is a really easy process once you get the idea. Here is my working code at GitHub. Now, let\u2019s [&#8230;]<\/p>\n","protected":false},"author":52,"featured_media":44434,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[873,187],"class_list":["post-9226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cloud-native","tag-ibm-bluemix"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using the Bluemix Insights for Twitter Service with a Rails App | Altoros<\/title>\n<meta name=\"description\" content=\"The article guides you through creating the IBM Bluemix Insights for Twitter service and binding it to a Rails app.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the Bluemix Insights for Twitter Service with a Rails App | Altoros\" \/>\n<meta property=\"og:description\" content=\"The tutorial also provides sample code for a proof of concept. &nbsp; A step-by-step tutorial Today, I will show how to use one of the many services provided by Bluemix in a Rails application. It is a really easy process once you get the idea. Here is my working code at GitHub. Now, let\u2019s [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-23T15:00:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-19T23:55:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1286\" \/>\n\t<meta property=\"og:image:height\" content=\"598\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Brian Cohen Falah\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brian Cohen Falah\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/\",\"name\":\"Using the Bluemix Insights for Twitter Service with a Rails App | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png\",\"datePublished\":\"2016-03-23T15:00:11+00:00\",\"dateModified\":\"2019-06-19T23:55:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/81ae103c8b8af66e5d38932c2c985376\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png\",\"width\":1286,\"height\":598},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the Bluemix Insights for Twitter Service with a Rails App\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/81ae103c8b8af66e5d38932c2c985376\",\"name\":\"Brian Cohen Falah\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Brian-Cohen-Falah-140x140.jpg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Brian-Cohen-Falah-140x140.jpg\",\"caption\":\"Brian Cohen Falah\"},\"description\":\"Brian Cohen Falah is an information systems engineer with 5+ years of experience in design, development, and maintenance of web-based applications. Brian specializes in Ruby on Rails, although he has also worked with Java, Android, PHP, jQuery, and other programming languages and frameworks. He likes using RSpec, RuboCop, and Code Climate.\",\"url\":\"https:\/\/www.altoros.com\/blog\/author\/b-cohen-falah\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the Bluemix Insights for Twitter Service with a Rails App | Altoros","description":"The article guides you through creating the IBM Bluemix Insights for Twitter service and binding it to a Rails app.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/","og_locale":"en_US","og_type":"article","og_title":"Using the Bluemix Insights for Twitter Service with a Rails App | Altoros","og_description":"The tutorial also provides sample code for a proof of concept. &nbsp; A step-by-step tutorial Today, I will show how to use one of the many services provided by Bluemix in a Rails application. It is a really easy process once you get the idea. Here is my working code at GitHub. Now, let\u2019s [...]","og_url":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/","og_site_name":"Altoros","article_published_time":"2016-03-23T15:00:11+00:00","article_modified_time":"2019-06-19T23:55:32+00:00","og_image":[{"width":1286,"height":598,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png","type":"image\/png"}],"author":"Brian Cohen Falah","twitter_misc":{"Written by":"Brian Cohen Falah","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/","url":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/","name":"Using the Bluemix Insights for Twitter Service with a Rails App | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png","datePublished":"2016-03-23T15:00:11+00:00","dateModified":"2019-06-19T23:55:32+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/81ae103c8b8af66e5d38932c2c985376"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/03\/ibm-bluemix-insights-for-twitter-vcap_services-v1-1.png","width":1286,"height":598},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/using-the-bluemix-insights-for-twitter-service-with-a-rails-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using the Bluemix Insights for Twitter Service with a Rails App"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/81ae103c8b8af66e5d38932c2c985376","name":"Brian Cohen Falah","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Brian-Cohen-Falah-140x140.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Brian-Cohen-Falah-140x140.jpg","caption":"Brian Cohen Falah"},"description":"Brian Cohen Falah is an information systems engineer with 5+ years of experience in design, development, and maintenance of web-based applications. Brian specializes in Ruby on Rails, although he has also worked with Java, Android, PHP, jQuery, and other programming languages and frameworks. He likes using RSpec, RuboCop, and Code Climate.","url":"https:\/\/www.altoros.com\/blog\/author\/b-cohen-falah\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/9226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=9226"}],"version-history":[{"count":4,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/9226\/revisions"}],"predecessor-version":[{"id":44436,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/9226\/revisions\/44436"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/44434"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=9226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=9226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=9226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}