Created
May 3, 2017 18:31
-
-
Save klashxx/ea963828c4712e4e7132fb854b4315b8 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import re | |
import urllib | |
with open('urls', 'r') as urls: | |
for url in urls: | |
if 'wiki' not in url: | |
continue | |
enc = re.search(r'https.*(?:File|Archivo):([^:]+)\.\S+$', url) | |
if enc is None: | |
continue | |
titulo = urllib.unquote_plus(enc.group(1)) | |
print ' '.join([palabra.capitalize() for palabra in titulo.split('_')])+':\n' | |
print '{{%s}}\n' % url.strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gracias @klashxx! :)