Skip to content

Instantly share code, notes, and snippets.

@petermd
Created September 25, 2015 09:24
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 petermd/4b4b727956f2306dc02b to your computer and use it in GitHub Desktop.
Save petermd/4b4b727956f2306dc02b to your computer and use it in GitHub Desktop.
import java.security.MessageDigest
def md5(String s) {
MessageDigest digest = MessageDigest.getInstance("MD5")
digest.update(s.bytes);
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
}
def check(p) {
try {
def url=("https://www.intercom.io/"+p).toURL()
def html=url.text
println "\nfetch(${url})="+md5(html)
}
catch(Exception e) {
print "x"
}
}
new File("emoji.csv").eachLine { l ->
def r=l.split(",")
check(r[1].replace("\\x","%"))
// Play nice
Thread.sleep(1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment