Delicious API and urllib2

Bill bsagert at gmail.com
Mon Apr 6 20:29:43 CEST 2009


The delicious api requires http authorization (actually https). A
generic delicious api post url is "https://
username:password at api.api.del.icio.us/v1/posts/add?url=http://
example.com/&description=interesting&tags=whatever".

This works fine when entered in the Firefox address bar. However
urllib2.urlopen(delicious_post_url) chokes and returns
"httplib.InvalidURL: nonnumeric port: 'password at api.del.icio.us".

Delicious really wants that authorization stuff embedded in the url as
it also rejected my attempts at using urllib2.HTTPBasicAuthHandler(),
etc.
Anybody have any hints?



More information about the Python-list mailing list