Created
December 27, 2009 02:01
-
-
Save jphastings/264122 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import re | |
| files = ["bbc.co.uk.js","bbc.co.uk>radio1>chart.js","bbc.co.uk>*>playlists.js"] | |
| doms = ["www.bbc.co.uk/radio1/chart/singles","bbc.co.uk","bbc.co.uk/radio1/playlists/","bbcnco.uk","notthebbc.co.uk"] | |
| # Goes to line 185 | |
| files.sort() | |
| files.reverse() | |
| for domain in doms: | |
| print "Domain: "+domain | |
| # Goes to Line 186 | |
| for filename in files: | |
| if filename.endswith('.js'): | |
| sre = re.compile('(.+\.)?'+re.escape(filename.split('.js')[0].replace('>','/')).replace('\*','.+')) | |
| if sre.match(domain): | |
| print " - matches: "+filename | |
| break |
This file contains hidden or 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
| Domain: www.bbc.co.uk/radio1/chart/singles | |
| - matches: bbc.co.uk>radio1>chart.js | |
| Domain: bbc.co.uk | |
| - matches: bbc.co.uk.js | |
| Domain: bbc.co.uk/radio1/playlists/ | |
| - matches: bbc.co.uk>*>playlists.js | |
| Domain: bbcnco.uk | |
| Domain: notthebbc.co.uk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment