Skip to main content

Home/ Diigo Community/ Question about API logins
Soul Book

Question about API logins - 73 views

api login httpauth greasemonkey firefox http-auth help application programming interface

started by Soul Book on 29 Jun 09
  • Soul Book
     
    Is this the right place to ask about the API?

    I don't really know what i'm doing, but i'm trying to make a greasemonkey script that gets some results from diigo. I've got it working, but each time i restart my browser, the next time i use that script i have to enter my username and password... which doesn't make it very user friendly.

    The only way i can find to bypass this is to log in my username and password automatically... but that doesn't seem very secure, and means i can't share the greasemonkey script.
    (eg: http://stackoverflow.com/questions/49158/greasemonkey-script-to-auto-login-using-http-authentication )

    Is there a way to get the api to recognise that i'm already logged in to diigo? Visiting the site or using the toolbar doesn't require me to log in all the time as it remembers me.. is there any way to tap into that? or a way to get an API key or something?
  • Soul Book
     
    Hmm.... a search for "api" on the right brings up nothing..

    But anyway, Its just a basic script to integrate diigo results into google results.
    I've got it working (though its unpolished so far - want to make it handle plurals, highlight entries, etc..) but the login issue makes it rather user unfriendly at the moment.

    Its my first script, so i'm making it up as i go along ;-)
  • Soul Book
     
    as far as i can tell its gonna be tricky. using HTTP-auth seems to require that the user log in each session.
    Diigo itself uses cookies to allow you to stay logged in, but i can't find any way for greasemonkey scripts to make use of that. Its tricky as it does seem to make the API rather hard to make use of. Maybe the dvs can give me some hints.

    From userscripts.org:
    "Note that Yumyum uses the del.icio.us web API, which requires you to log in again, with HTTP-Authentication. When you open your del.icio.us page for the first time after starting your browser, you will be prompted for your user name and password. This dialog is not controlled by the Yumyum script.

    Beware that yumyum may get confused if you are using more than one del.icio.us account - actions will always be performed on the account you first loged into to, you have to completely close the browser to reset it. This is due to the fact the del.icio.us web API uses HTTP-Authentication, which a) cannot be reset (no "logout" option), and also yumyum has no access to the authentication data, and cannot check with which ID you are logged into the API. I hope I'll find a way around this some day. "

    This seems to be the same problem i'm having. I'll keep working on it.
  • Soul Book
     
    Further questions, if any devs are reading this...

    1 - what are the API limits?

    I've been testing my script and i'm sometimes running into errors where i go over the API limit. I guess this is number of queries per second or something?

    Ideally, to get the results i want, i need to run 2-3 separate queries. Is that gonna go over the limit?

    2 - is there a way to do an OR search for tags? eg: "book" or "books"
    I'm trying to get around the singular/plural tags problem by searching for both.. but it won't work because it's an AND query.
  • Graham Perrin
  • Graham Perrin
     
    I messed up my own example, which uses a multiple word tag. Third time lucky:
    http://www.diigo.com/search?adSScope=my&what=tag%3A(iPhone)%20OR%20tag%3A(iPhone%20OS%203)

To Top

Start a New Topic » « Back to the Diigo Community group