Mercurial > hg > index.fcgi > www > www-1
comparison myrss/myrss_app.py @ 75:ec48011dca1e
pics2: lazy load images in index page
author | paulo |
---|---|
date | Thu, 11 Feb 2016 00:02:19 -0800 |
parents | c7bbd3805509 |
children | 51f0da3da721 |
comparison
equal
deleted
inserted
replaced
7:ba1b1cbb0de6 | 8:d6b0b739bda9 |
---|---|
157 | 157 |
158 | 158 |
159 def _fetch_url(url): | 159 def _fetch_url(url): |
160 try: | 160 try: |
161 logging.info("processing %s" % url) | 161 logging.info("processing %s" % url) |
162 feed = urllib2.urlopen(urllib2.Request(url, headers={"User-Agent": ''}), timeout=URLOPEN_TIMEOUT) | 162 feed = urllib2.urlopen(urllib2.Request(url, headers={"User-Agent": "Mozilla/5.0"}), timeout=URLOPEN_TIMEOUT) |
163 except urllib2.HTTPError as e: | 163 except urllib2.HTTPError as e: |
164 logging.info("(%s) %s" % (url, e)) | 164 logging.info("(%s) %s" % (url, e)) |
165 return None | 165 return None |
166 | 166 |
167 return feed | 167 return feed |