Skip to content

Instantly share code, notes, and snippets.

@pdehaan
Created June 20, 2015 00:36
Show Gist options
  • Select an option

  • Save pdehaan/32efce19780bc6beb089 to your computer and use it in GitHub Desktop.

Select an option

Save pdehaan/32efce19780bc6beb089 to your computer and use it in GitHub Desktop.
Grab a JSON manifest from a remote GitHub URL
import groovy.json.JsonSlurper
Map getJson(String project) {
String repoUrl = "https://raw.githubusercontent.com/mozilla-services/services-test/master/e2e/${project}/package.json".toString()
JsonSlurper jsonSlurper = new JsonSlurper()
return jsonSlurper.parse(repoUrl.toURL())
}
Map datum = getJson('pocket')
println datum.name + '@' + datum.version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment