Mercurial > hg > index.fcgi > www > www-1
changeset 74:d6acf8b093b7
myrss: update user-agent string to "Mozilla/5.0" to fix servers that insist on one
author | paulo |
---|---|
date | Wed, 27 Jan 2016 01:50:15 -0700 |
parents | 7fa40181ad24 |
children | ec48011dca1e |
files | myrss/myrss_app.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/myrss/myrss_app.py Sat Jan 09 01:04:03 2016 -0700 1.2 +++ b/myrss/myrss_app.py Wed Jan 27 01:50:15 2016 -0700 1.3 @@ -159,7 +159,7 @@ 1.4 def _fetch_url(url): 1.5 try: 1.6 logging.info("processing %s" % url) 1.7 - feed = urllib2.urlopen(urllib2.Request(url, headers={"User-Agent": ''}), timeout=URLOPEN_TIMEOUT) 1.8 + feed = urllib2.urlopen(urllib2.Request(url, headers={"User-Agent": "Mozilla/5.0"}), timeout=URLOPEN_TIMEOUT) 1.9 except urllib2.HTTPError as e: 1.10 logging.info("(%s) %s" % (url, e)) 1.11 return None