Heyho!
I want to test the API with Python (just 4 fun), but I can't authorize...
PHP Code:
import urllib.request, urllib.p****
username="*"
p***word="*"
text="Testing the Twitter API with python... :)"
prm=urllib.p****.urlencode({"status":text})
# Encode the POST-Parameter
# Create an OpenerDirector with support for Basic HTTP Authentication...
auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_p***word(realm=None,
uri='http://twitter.com',
user= username,
p***wd= p***word)
opener = urllib.request.build_opener(auth_handler)
# ...and install it globally so it can be used with urlopen.
urllib.request.install_opener(opener)
f=urllib.request.urlopen("http://twitter.com/statuses/update.xml", prm) # send...
print(f)
What a nice bot btw...