Mercurial > hg > index.fcgi > www > www-1
diff myrss/myrss_app.py @ 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 | c7bbd3805509 |
children | 51f0da3da721 |
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