Created
October 24, 2014 14:13
-
-
Save cnDelbert/59a03b5b23cc347aad3b to your computer and use it in GitHub Desktop.
Download all js and css files from SyntaxHighlighter
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
# coding:utf-8 | |
# Python 3.4 | |
# Download all js and css files from SyntaxHighlighter | |
# __author__ = Delbert | |
from urllib import request | |
url_arr = ["http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushColdFusion.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushErlang.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js", | |
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"] | |
for url in url_arr: | |
filename = url.split('/')[-1] | |
js = request.urlopen(url).read().decode() | |
f = open(filename, "wt+") | |
f.write(js) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment