Skip to content

Commit

Permalink
Comment out the line that sets User-Agent via add_headers
Browse files Browse the repository at this point in the history
It seems that if you try to set the User-Agent via addheaders, as
suggested at the bottom of this page:

  http://docs.python.org/library/urllib2.html

... then it seems that redirections are no longer followed.
  • Loading branch information
mhl committed Nov 5, 2012
1 parent c81cc76 commit 7a666e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions delicious-recent-summary
Expand Up @@ -29,6 +29,8 @@ from collections import defaultdict
# 302 redirection loop:
cj = CookieJar()
url_opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
# url_opener.addheaders.append(('User-Agent',
# 'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3 GTB7.1'))

# An sqlite database that keeps track of which links have already been
# reported, and when the triggering number of new links was last hit:
Expand Down

0 comments on commit 7a666e3

Please sign in to comment.