Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 1 month ago by Anonymous
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
/* Hello World in Groovy */def curl = """ 
{
  "login": "AndrewGleason",
  "id": 2333382,
  "node_id": "MDQ6VXNlcjIzMzMzODI=",
  "avatar_url": "https://avatars.githubusercontent.com/u/2333382?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/AndrewGleason",
  "html_url": "https://github.com/AndrewGleason",
  "followers_url": "https://api.github.com/users/AndrewGleason/followers",
  "following_url": "https://api.github.com/users/AndrewGleason/following{/other_user}",
  "gists_url": "https://api.github.com/users/AndrewGleason/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/AndrewGleason/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/AndrewGleason/subscriptions",
  "organizations_url": "https://api.github.com/users/AndrewGleason/orgs",
  "repos_url": "https://api.github.com/users/AndrewGleason/repos",
  "events_url": "https://api.github.com/users/AndrewGleason/events{/privacy}",
  "received_events_url": "https://api.github.com/users/AndrewGleason/received_events",
  "type": "User",
  "site_admin": false,
  "name": "Andrew Gleason",
  "company": "Salesforce",
  "blog": "",
  "location": "San Francisco, CA",
  "email": null,
  "hireable": null,
  "bio": null,
  "twitter_username": null,
  "public_repos": 0,
  "public_gists": 0,
  "followers": 3,
  "following": 4,
  "created_at": "2012-09-12T16:36:59Z",
  "updated_at": "2021-06-30T02:32:47Z"
}
\\n200%
"""

println(curl.split("}").last().trim())