To be more specific:
My delicious account is a Yahoo ID so access via OAuth 开发者_StackOverflowis required.
It's for my use only to add/remove bookmarks. I have the password.
It's a command line python program, not web-based.
My question is:
Is it possible to access my delicious account without being redirected to a Yahoo OAuth authorization page? Any examples are appreciated.
Yes, but only if you go through the authorisation process once, to link your account to your application.
After that, you can re-authorise your existing information by using the session ID supplied from the original request.
I think http://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html has the detail.
What you probably actually want to do is set oauth_callback=oob
(out of bounds). Instead of redirecting you, it will give you a verification code for you to paste into your command line. This feature is meant for non-web based situations like yours.
Also, since you're in Python you can use this trick to launch the a browser to the authorization url:
import webbrowser
webbrowser.open(url)
This is an older question, but since Yahoo has since sold off Delicious. The "new" Delicious is still compatible with the original API, but they have dropped the OAuth support. (It was tied directly to Yahoo's authentication system which the new company of course does not have access to.)
Otherwise the new API is mostly compatible with the previous (non-OAuth) version: http://delicious.com/help/api
精彩评论