Created
December 19, 2017 22:00
-
-
Save UnluckyNinja/dd5761ef170ed658eb11118766b4a15a to your computer and use it in GitHub Desktop.
http://www.jeffersoncheng.com/Anonymous-Animals Base on: https://gist.github.com/rockwotj/6a356a95732985b09e2b and https://evert.meulie.net/faqwd/complete-list-anonymous-animals-on-google-drive-docs-sheets-slides/
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
@Grab(group='commons-io', module='commons-io', version='2.4') | |
import org.apache.commons.io.FilenameUtils | |
// bear, dog, lion seem not work | |
def icons = ['alligator', 'anteater', 'armadillo', 'auroch', 'axolotl', 'badger', 'bat', 'bear', 'beaver', 'buffalo', 'camel', 'capybara', 'chameleon', 'cheetah', 'chinchilla', 'chipmunk', 'chupacabra', 'cormorant', 'coyote', 'crow', 'dingo', 'dinosaur', 'dog', 'dolphin', 'duck', 'elephant', 'ferret', 'fox', 'frog', 'giraffe', 'gopher', 'grizzly', 'hedgehog', 'hippo', 'hyena', 'ibex', 'ifrit', 'iguana', 'jackal', 'kangaroo', 'koala', 'kraken', 'lemur', 'leopard', 'liger', 'lion', 'llama', 'slow loris', 'manatee', 'mink', 'monkey', 'moose', 'narwhal', 'nyan cat', 'orangutan', 'otter', 'panda', 'penguin', 'platypus', 'pumpkin', 'python', 'quagga', 'rabbit', 'raccoon', 'rhino', 'sheep', 'shrew', 'skunk', 'squirrel', 'tiger', 'turtle', 'walrus', 'wolf', 'wolverine', 'wombat'] | |
def url = 'https://ssl.gstatic.com/docs/common/profile/$$_lg.png' | |
def urls = icons.collect{ | |
url.replace('$$',it.replace(' ','')).toURL() | |
} | |
urls.each{ | |
def filename = FilenameUtils.getName(it.file) | |
def file = new File(filename) | |
if(!file.exists()){ | |
file.createNewFile() | |
}else{ | |
return | |
} | |
try{ | |
file.withOutputStream{ fileoutput -> | |
it.withInputStream{ urlinput -> | |
fileoutput << urlinput | |
} | |
} | |
}catch(e){ | |
println "$filename failed" | |
return | |
} | |
println "finished $filename" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment