Skip to content

Instantly share code, notes, and snippets.

@fumokmm
Created November 14, 2009 10:39
Show Gist options
  • Save fumokmm/234474 to your computer and use it in GitHub Desktop.
Save fumokmm/234474 to your computer and use it in GitHub Desktop.
文字列をスクリプトとして実行する。これは便利。
import hatenahaiku4j.*
api = new HatenaHaikuAPILight()
str = """
def konna = api.getHotKeywordList().first()
def konnaUsers = konna.api.getTimeline()*.user
def konnaKeyword = konnaUsers.collect{
it.api.getTimeline()*.keyword
}.flatten().unique()
"""
def shell = new GroovyShell()
shell.setVariable('api', api)
def result = shell.evaluate(str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment