Skip to content

Instantly share code, notes, and snippets.

@uemuraj
Last active August 29, 2015 14:07
Show Gist options
  • Save uemuraj/17b96386f5286fc7e6ed to your computer and use it in GitHub Desktop.
Save uemuraj/17b96386f5286fc7e6ed to your computer and use it in GitHub Desktop.
Java SE のチェックサムのページを md5sum コマンド用ファイルに変換する
def pattern = ~/<td>(?<filename>((jdk)|((server-)*jre))-.+)<\/td><td>(?<checksum>\p{XDigit}+)<\/td>/
args.each {
def url = new URL(it)
def out = new File(new File(url.path).name.replaceFirst(/\.html$/, '.txt'))
url.eachLine {
def matcher = pattern.matcher(it)
if (matcher.find()) {
out.append("${matcher.group('checksum')} *${matcher.group('filename')}\n")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment