Skip to content

Commit

Permalink
Merge pull request #1 from jccooper/patch-1
Browse files Browse the repository at this point in the history
Add user-agent to urllib2 to fix 403s
  • Loading branch information
glenbot committed Nov 27, 2013
2 parents a2ca46e + 114cc2c commit 1a05193
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions campbx/campbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
log.addHandler(log_handler)
log.setLevel(logging.ERROR)

opener = urllib2.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib2.install_opener(opener)


class EndPointPartial(partial):
def __new__(cls, func, conf, _repr):
Expand Down

0 comments on commit 1a05193

Please sign in to comment.