Skip to content

Instantly share code, notes, and snippets.

@tyama
Created February 8, 2010 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyama/298318 to your computer and use it in GitHub Desktop.
Save tyama/298318 to your computer and use it in GitHub Desktop.
def api = "R_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
def user = "your user name"
def url = "http://tv.yahoo.co.jp"
def version ="2.0.1"
def u = "http://api.bit.ly/shorten?version=${version}&longUrl=${url}&login=${user}&apiKey=${api}"
def shorten = new URL(u)
def result = shorten.text
if(result!=""){
def str = result.replaceAll(/}/, ']').replaceAll(/\{/, '[')
def map = evaluate(str)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment