I try to do my first steps with the Twitter API, but I always get a 401 with this python 3 code. I douplechecked the credentials twice, they are surely correct. What am I doing wrong. Thankks in advance,
Gerald
auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_password(realm="Twitter API",
uri="http://example.com",
user="123",
passwd="123")
opener = urllib.request.build_opener(auth_handler)
urllib.request.install_opener(opener)
f = urllib.request.urlopen('http://twitter.com/friendships/destroy/scoop_at.json')
print(f.read())