{"id":1810,"date":"2012-09-18T01:00:00","date_gmt":"2012-09-18T01:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/twitter-rest-api-from-scala-and-java-using-signpost.html"},"modified":"2012-10-22T06:50:58","modified_gmt":"2012-10-22T06:50:58","slug":"twitter-rest-api-from-scala-and-java","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html","title":{"rendered":"Twitter REST API from Scala and Java using signpost"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">If you&#8217;ve read some other articles on this blog you might know that I like creating visualizations of various datasets. I&#8217;ve just started a small project where I want to visualize some data from Twitter. For this I want to retrieve information about followers and profile information directly from twitter. I actually started looking for a set of all twitter accounts, but could only find one that was two years old. So, only option left, directly access the twitter API and get the data myself. <\/p>\n<p>There are a couple of open source libraries out that we can use directly from Scala (or java) but as far as I could see they use the old v1 API and not the v1.1 API. The old API has a very strict data rate limit, which is a bit lighter in the new API. And besides that I&#8217;m more interested in the raw data and parsing the returning JSON isn&#8217;t that hard with Scala (or Java for that matter).<br \/>\n<strong><br \/>\n<\/strong><strong>Register an application at twitter<\/strong>            <\/p>\n<p>First thing to do, and easiest way to get started is registing a new application for your twitter account. Go to <a href=\"https:\/\/dev.twitter.com\/apps\/new\">https:\/\/dev.twitter.com\/apps\/new<\/a> and create a new application. Don&#8217;t worry about the urls, since we won&#8217;t be using the OAuth callback mechanism:             <\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-gKbohPztF68\/UFdoLNLKGxI\/AAAAAAAACLo\/AjLvnTatQ_w\/s1600\/Create+1+-+Twitter+Developers.png\"><img decoding=\"async\" border=\"0\" height=\"212\" src=\"http:\/\/1.bp.blogspot.com\/-gKbohPztF68\/UFdoLNLKGxI\/AAAAAAAACLo\/AjLvnTatQ_w\/s320\/Create+1+-+Twitter+Developers.png\" width=\"320\" \/><\/a><\/div>\n<p>Depending on what you want to do with the API you need to give additional permissions to this app. Default is &#8216;read-only&#8217;, if you want to allow your new application to post or access your direct messages you need to update the permissions. This is done from the settings page of your application:             <\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-2ahmTvfv_fg\/UFdoYGPwo4I\/AAAAAAAACLw\/1zUiqVt0gDI\/s1600\/SmartjavaTest+-+Twitter+Developers.png\"><img decoding=\"async\" border=\"0\" height=\"220\" src=\"http:\/\/4.bp.blogspot.com\/-2ahmTvfv_fg\/UFdoYGPwo4I\/AAAAAAAACLw\/1zUiqVt0gDI\/s320\/SmartjavaTest+-+Twitter+Developers.png\" width=\"320\" \/><\/a><\/div>\n<p>Once you&#8217;ve created the application and setup the correct permissions you can generate an access token. Doing this will avoid having to go through the complete OAuth dance. You do this by going to your new app details and at the bottom select the &#8216;create my access token&#8217; option.             <\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-w8v2XzbTdPE\/UFdodiUPmkI\/AAAAAAAACL4\/6BttpgVxj-o\/s1600\/Create+2+-+Twitter+Developers.png\"><img decoding=\"async\" border=\"0\" height=\"204\" src=\"http:\/\/3.bp.blogspot.com\/-w8v2XzbTdPE\/UFdodiUPmkI\/AAAAAAAACL4\/6BttpgVxj-o\/s320\/Create+2+-+Twitter+Developers.png\" width=\"320\" \/><\/a><\/div>\n<p>Now you&#8217;ll have a set of tokens (see the details part of your applications):             <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-k28Zwgw-ZnY\/UFdoiWhh7qI\/AAAAAAAACMA\/12Di5wdXO9M\/s1600\/SmartjavaTest+-+Twitter+Developers-1.png\"><img decoding=\"async\" border=\"0\" height=\"220\" src=\"http:\/\/2.bp.blogspot.com\/-k28Zwgw-ZnY\/UFdoiWhh7qI\/AAAAAAAACMA\/12Di5wdXO9M\/s320\/SmartjavaTest+-+Twitter+Developers-1.png\" width=\"320\" \/><\/a><\/div>\n<p>We&#8217;ll use these tokens to authenticate the requests we&#8217;ll make to twitter.<br \/>\n<strong><br \/>\n<\/strong><strong>Using a OAuth library<\/strong>            <\/p>\n<p>The OAuth protocol is a pretty good documented protocol, but implementing it yourself is a lot of work and very error-prone. Luckily there are many OAuth libraries that can help you. I&#8217;ve tried a couple and the one that&#8217;s most easy to use (at least for me) was <a href=\"http:\/\/code.google.com\/p\/oauth-signpost\/\">signpost<\/a>. The examples below show how to do this from Scala, but you can follow the same approach for Java.             <\/p>\n<p>First the dependencies. I&#8217;ve used sbt and from signpost I use the client with support for HTTP commons. In sbt add the following:                          <\/p>\n<pre class=\"brush:java\">..\r\nlibraryDependencies ++= Seq(\r\n 'oauth.signpost' % 'signpost-core' % '1.2',\r\n 'oauth.signpost' % 'signpost-commonshttp4' % '1.2', \r\n 'org.apache.httpcomponents' % 'httpclient' % '4.2',\r\n         ...\r\n)<\/pre>\n<p>For maven you can use the same libraries. Next we can write a simple test to see if everything is working. In java it looks like this:                          <\/p>\n<pre class=\"brush:java\">import oauth.signpost.OAuthConsumer;\r\nimport oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;\r\n \r\nimport org.apache.commons.io.IOUtils;\r\nimport org.apache.http.HttpResponse;\r\nimport org.apache.http.client.HttpClient;\r\nimport org.apache.http.client.methods.HttpGet;\r\nimport org.apache.http.impl.client.DefaultHttpClient;\r\n \r\n \r\npublic class Tw {\r\n \r\n   static String AccessToken = 'access token for your app';\r\n   static String AccessSecret = 'access secret for your app';\r\n   static String ConsumerKey = 'consumer key for your app';\r\n   static String ConsumerSecret = 'consumer secret for your app';\r\n \r\n \/**\r\n  * @param args\r\n  *\/\r\n public static void main(String[] args) throws Exception {\r\n  OAuthConsumer consumer = new CommonsHttpOAuthConsumer(\r\n                ConsumerKey,\r\n                ConsumerSecret);\r\n \r\n        consumer.setTokenWithSecret(AccessToken, AccessSecret);\r\n        HttpGet request = new HttpGet('http:\/\/api.twitter.com\/1.1\/followers\/ids.json?cursor=-1&amp;screen_name=josdirksen');\r\n        consumer.sign(request);\r\n \r\n        HttpClient client = new DefaultHttpClient();\r\n        HttpResponse response = client.execute(request);\r\n \r\n        int statusCode = response.getStatusLine().getStatusCode();\r\n        System.out.println(statusCode + ':' + response.getStatusLine().getReasonPhrase());\r\n        System.out.println(IOUtils.toString(response.getEntity().getContent()));\r\n }\r\n}<\/pre>\n<p>And in Scala it looks pretty much the same:                          <\/p>\n<pre class=\"brush:java\">import org.apache.http.client.HttpClient\r\nimport org.apache.http.impl.client.DefaultHttpClient\r\nimport org.apache.http.client.methods.HttpGet\r\nimport oauth.signpost.commonshttp.CommonsHttpOAuthConsumer\r\nimport org.apache.commons.io.IOUtils\r\n \r\n \r\nobject TwitterPull {\r\n \r\n   val AccessToken = 'access token for your app';\r\n   val AccessSecret = 'access secret for your app';\r\n   val ConsumerKey = 'consumer key for your app';\r\n   val ConsumerSecret = 'consumer secret for your app';\r\n \r\n \r\n  def main(args: Array[String]) {\r\n \r\n  val consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret);\r\n  consumer.setTokenWithSecret(AccessToken, AccessSecret);\r\n \r\n     val request = new HttpGet('http:\/\/api.twitter.com\/1.1\/followers\/ids.json?cursor=-1&amp;screen_name=josdirksen');\r\n     consumer.sign(request);\r\n     val client = new DefaultHttpClient();\r\n     val response = client.execute(request);\r\n \r\n     println(response.getStatusLine().getStatusCode());\r\n     println(IOUtils.toString(response.getEntity().getContent()));\r\n  }\r\n}<\/pre>\n<p>When you run this the output will look something like this:               <\/p>\n<pre class=\"brush:bash\">200\r\n{\"previous_cursor_str\":\"0\",\"next_cursor\":0,\"ids\":\r\n[48342167,21011010,824959303,97242821,16953163,218083367,20869799,5234221,13604142,80\r\n4783128,271050984,405121284,26470609,50201837,1723451,374494377,120867838,14311946,25\r\n3114713,39554511,7375412,42507395,112806109,92787154,218238023,110443797,76922155,198\r\n798790,294104985,305625416,217698029,21803482,14927822,15453445,15715866,15657036,186\r\n956616,36028164,70380613,326158542,573546312,14401332,521488579,9108612,576970378,293\r\n236313,16398366,16220300,15234937,32000283,439444353,14300622,67204409,155850135,1419\r\n8255,32264673,15852981,313248158,20123099,608942046,234930032,36896958,18466675,45496\r\n942,330899833,18980755,88253383,461023805,31175627,11044952,142780445,63175189,107991\r\n607,94830953,600993241,6195002,115391430,550080945,381418927,168603682,142388604,8258\r\n462,218411138,30450578,77728346,2521381,182867524,494119147,29426983,572417260,943448\r\n49,325413275,389354525,501438275,164346498,22730282,8293302,21085554,341645357,569788\r\n53,180507788,10074002,22536424,14247654,581293627,15259428,483317230,462826270,477464\r\n1,15366832,96850673,278486993,22273826,17716679,14566626,158473088,20461042,161242434\r\n,43756629,40163100,141165981,5325152,7620782,266749648,524476136,557713614,39602637,1\r\n8843154,1623,565954426,39639621,166672305,18683074,233118689,44876099,235258223,21931\r\n0062,10699922,12660502,218030046,91552210,19361980,206645598,35346200,58440021,470388\r\n557,26495649,59066453,40292255,543375441,33242290,6015852,317150447,22935775,23230034\r\n6,476045917,90913482,249088920,67658976,614873,522722520,186766721,285517705,71683175\r\n,131444964,166501605,477920664,38154550,18738205,8861832,15594932,18536741,7595202,46\r\n5378842,11838952,14848133,431696576,14358671,414520167,222578501,67058139,28976735,95\r\n601387,426582611,24874129,418762594,128157235,106030956,31352215,18733178,260196778,1\r\n53179029,91842580,229494512,83414433,285579699,19957600,54295155,14929418,51516573,20\r\n0076011,18758733,17776895,59397841,216802709,149834999,327507356,8200322,174345369,10\r\n8636400,27504001,326877592,139919716,49949338,215035403,118421144,49410665,149550914,\r\n18446431,25662335,261725134,267634174,57737391,146506056,126964949,71055234,20870640,\r\n210196418,222806923,13290742,72247756,180410163,14784480,36684216,25611502,95614691,5\r\n4629161,112967594,181656257,17994312,72918901,140082918,149087212,137272324,99534020,\r\n121755576,93964779,35848342,43059008,34704029,87672717,113137792,17863333,90407665,90\r\n591814,54297023,57924897,87551006,28300354,48990752,26188013],\"previous_cursor\":0,\r\n\"next_cursor_str\":\"0\"\r\n<\/pre>\n<p>If you get a 403 check whether the tokens match.<\/p>\n<p>Happy coding and don&#8217;t forget to share!<\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/www.smartjava.org\/content\/access-twitter-rest-api-v11-scala-and-java-using-signpost\">Access the Twitter REST API (v1.1) from Scala and Java using signpost<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Jos Dirksen  at the <a href=\"http:\/\/www.smartjava.org\/\">Smart Java<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve read some other articles on this blog you might know that I like creating visualizations of various datasets. I&#8217;ve just started a small project where I want to visualize some data from Twitter. For this I want to retrieve information about followers and profile information directly from twitter. I actually started looking for &hellip;<\/p>\n","protected":false},"author":152,"featured_media":248,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[384],"class_list":["post-1810","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-twitter"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Twitter REST API from Scala and Java using signpost - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"If you&#039;ve read some other articles on this blog you might know that I like creating visualizations of various datasets. I&#039;ve just started a small project\" \/>\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.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Twitter REST API from Scala and Java using signpost - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"If you&#039;ve read some other articles on this blog you might know that I like creating visualizations of various datasets. I&#039;ve just started a small project\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-09-18T01:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T06:50:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/twitter-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jos Dirksen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jos Dirksen\" \/>\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\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html\"},\"author\":{\"name\":\"Jos Dirksen\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/acea79921fb475b4914893ba4fec1d33\"},\"headline\":\"Twitter REST API from Scala and Java using signpost\",\"datePublished\":\"2012-09-18T01:00:00+00:00\",\"dateModified\":\"2012-10-22T06:50:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html\"},\"wordCount\":549,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/twitter-logo.jpg\",\"keywords\":[\"Twitter\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html\",\"name\":\"Twitter REST API from Scala and Java using signpost - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/twitter-logo.jpg\",\"datePublished\":\"2012-09-18T01:00:00+00:00\",\"dateModified\":\"2012-10-22T06:50:58+00:00\",\"description\":\"If you've read some other articles on this blog you might know that I like creating visualizations of various datasets. I've just started a small project\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/twitter-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/twitter-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/twitter-rest-api-from-scala-and-java.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Twitter REST API from Scala and Java using signpost\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/acea79921fb475b4914893ba4fec1d33\",\"name\":\"Jos Dirksen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g\",\"caption\":\"Jos Dirksen\"},\"sameAs\":[\"http:\\\/\\\/www.smartjava.org\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Jos-Dirksen\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Twitter REST API from Scala and Java using signpost - Java Code Geeks","description":"If you've read some other articles on this blog you might know that I like creating visualizations of various datasets. I've just started a small project","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.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html","og_locale":"en_US","og_type":"article","og_title":"Twitter REST API from Scala and Java using signpost - Java Code Geeks","og_description":"If you've read some other articles on this blog you might know that I like creating visualizations of various datasets. I've just started a small project","og_url":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-09-18T01:00:00+00:00","article_modified_time":"2012-10-22T06:50:58+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/twitter-logo.jpg","type":"image\/jpeg"}],"author":"Jos Dirksen","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jos Dirksen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html"},"author":{"name":"Jos Dirksen","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/acea79921fb475b4914893ba4fec1d33"},"headline":"Twitter REST API from Scala and Java using signpost","datePublished":"2012-09-18T01:00:00+00:00","dateModified":"2012-10-22T06:50:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html"},"wordCount":549,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/twitter-logo.jpg","keywords":["Twitter"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html","url":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html","name":"Twitter REST API from Scala and Java using signpost - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/twitter-logo.jpg","datePublished":"2012-09-18T01:00:00+00:00","dateModified":"2012-10-22T06:50:58+00:00","description":"If you've read some other articles on this blog you might know that I like creating visualizations of various datasets. I've just started a small project","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/twitter-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/twitter-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/twitter-rest-api-from-scala-and-java.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Twitter REST API from Scala and Java using signpost"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/acea79921fb475b4914893ba4fec1d33","name":"Jos Dirksen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g","caption":"Jos Dirksen"},"sameAs":["http:\/\/www.smartjava.org\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Jos-Dirksen"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/152"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1810"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1810\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/248"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}