Skip to content

Instantly share code, notes, and snippets.

@klashxx
Created May 3, 2017 18:31
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 klashxx/ea963828c4712e4e7132fb854b4315b8 to your computer and use it in GitHub Desktop.
Save klashxx/ea963828c4712e4e7132fb854b4315b8 to your computer and use it in GitHub Desktop.
#!/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()
@klashxx
Copy link
Author

klashxx commented May 4, 2017

Buen trabajo @josejuansanchez

@josejuansanchez
Copy link

Gracias @klashxx! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment