Last active
August 29, 2015 14:07
-
-
Save uemuraj/17b96386f5286fc7e6ed to your computer and use it in GitHub Desktop.
Java SE のチェックサムのページを md5sum コマンド用ファイルに変換する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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