rubys / venus

Planet Venus is an awesome ‘river of news’ feed reader. It downloads news feeds published by web sites and aggregates their content together into a single combined feed, latest news first.
http://intertwingly.net/code/venus/docs/index.html
Other
273 stars 99 forks source link

Use a user-agent other than the httplib2 default. #22

Open ralphbean opened 11 years ago

ralphbean commented 11 years ago

There is something about the default httplib2 user-agent that causes some web servers to throw up.

Try this, for example::

>>> import httplib2
>>> h = httplib2.Http()
>>> response, content = h.request(
...   "http://ankursinha.in/blog/feed/")
>>> response.status
406
>>> response, content = h.request(
...   "http://ankursinha.in/blog/feed/",
...   headers={'user-agent': 'trololololololol 9000'})
>>> response.status
200
james-see commented 8 years ago

Adding a custom user agent mitigated my issue with BadStatusLine errors. Thanks