Created
June 2, 2011 19:21
Revisions
-
sebastienblanc revised this gist
Jun 3, 2011 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,17 @@ http.get( path: 'search.json', } }] } def show = {String s -> [trending: {String s3 -> def http = new HTTPBuilder( 'http://api.twitter.com/1/' ) http.get( path: 'trends.json') { resp, json -> json.trends.each { println ' ' + it.name } } }] } //search twitter DSL search tweets about 'twitter search groovy' show current trending topics -
sebastienblanc revised this gist
Jun 2, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def http = new HTTPBuilder( 'http://search.twitter.com/' ) def tweets = 'tweets' def search = {String s -> [about: {String s2 -> http.get( path: 'search.json', query: [q:s2] ) { resp, json -> json.results.each { println ' ' + it.text } -
sebastienblanc created this gist
Jun 2, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ import groovyx.net.http.* @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.1' ) def http = new HTTPBuilder( 'http://search.twitter.com/' ) def tweets = 'tweets' def search = {String s -> [about: {String s2 -> http.get( path: 'search.json', query: [q:s2, count:5] ) { resp, json -> json.results.each { println ' ' + it.text } } }] } //search twitter DSL search tweets about 'groovy'