Advertisement
Guest User

fitoria

a guest
Feb 24th, 2008
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. #/usr/bin/python
  2. """Programa para bajar todas las tiras de Bilo y Nano desde tiraecol.net
  3. autor: Adolfo Jurgen Fitoria Escobar <adolfo.fitoria@gmail.com> http://fitoria.blogspot.com
  4. Agradecimientos: Igor Guerrero por aclalar algunas dudas
  5. Bajo los terminos de la licencia GPL v3
  6. Managua, Nicaragua 24/02/2008"""
  7. import feedparser
  8. import re
  9. from urllib import urlopen
  10.  
  11. tiras= feedparser.parse("http://www.tiraecol.net/modules/comic/cache/tiraecol-RSS2.0.xml")
  12. numero_de_tiras= int(re.search('(?<=content_id=)\d+',tiras.entries[0].link).group(0))
  13. print numero_de_tiras
  14. while numero_de_tiras>0:   
  15.     url="http://www.tiraecol.net/modules/comic/cache/images/tiraecol-" + str(numero_de_tiras) + ".png"
  16.     tira=urlopen(url)
  17.     nombre_archivo="TiraEcol-"+str(numero_de_tiras)+".png" 
  18.     f = file(nombre_archivo, "wb+")
  19.     f.write(tira.read())
  20.     numero_de_tiras-=1
  21.     print "Se ha descargado el archivo: " + nombre_archivo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement