Forums

Give help. Get help.

  • __
    # January 13, 2013 at 1:31 am

    > If I went to /example, I’d get a PHP error. I went to /example/twitter, I’d get the same error you received and if I refreshed that same page, the error would show what the problem was.

    `Warning: array_key_exists() …`
    `Invalid auth response: Missing key auth response components.` ?

    That’s actually a PHP error, because when you refreshed the page there was no longer an auth response. The example files have no error checking whatsoever.

    If you got something else, what did it say?

    # January 13, 2013 at 1:57 am

    @traq

    > Warning: array_key_exists() …
    Invalid auth response: Missing key auth response components. ?

    That’s the one. I didn’t receive any other error besides that.

    # January 13, 2013 at 1:42 pm

    From briefly talking to the author of Opauth, this is on Twitter’s end apparently.

    Additionally, I read on the discussion area of the API docs that it could be caused by the time of my server not being synced to Twitter’s server time. However, I don’t see this to be the cause after testing locally and on a live server.

    __
    # January 13, 2013 at 2:49 pm

    > From briefly talking to the author of Opauth, this is on Twitter’s end apparently.

    Did he have any insights as to what twitter’s problem is? AFAICT, Opauth seems to follow twitter’s API requirements.

    # January 13, 2013 at 4:43 pm

    @traq No. He just told me to contact Twitter. I just replied to that and basically said, “if it was on Twitter’s end, why would it work on an alternate library?”.

    __
    # January 13, 2013 at 5:02 pm

    ’cause the alt lib knows what twitter’s on about. : )

    is Shiflett’s code what you tried that works?

    # January 13, 2013 at 5:13 pm

    @traq Ha. Yes, it is. I got the library from here.

    Now I just have to figure out how to use the API to post comments. Not sure if I should integrate it with Kirby’s auth plugin or if that isn’t necessary.

    __
    # January 13, 2013 at 5:24 pm

    Is this session-only (twitter provides all info you need, users comment thru twitter), or are you integrating more tightly with your site (twitter authenticates, but you’re storing the comments yourself (and possibly other user data also))? Do you need to assign permissions to users that you won’t be able to determine indirectly, based on the info twitter provides?

    Basically, are you flat-out *using twitter accounts on your site*, or are you only *using twitter as a sign-in mechanism*?

    # January 13, 2013 at 5:40 pm

    @traq Let me turn this around, what would you suggest?

    I just want the user to be able to use their Twitter credentials (username and profile photo) for posting comments. Example.

    In the form, I would also prefer that I have an edit option for the user to correct any mistakes. This stops them from commenting multiple times to clear up an error.

    __
    # January 13, 2013 at 7:03 pm

    Personally, I’d want to keep the comments myself – that doesn’t mean it’s a “better” solution, it’s just what I’d want. I’d maintain my own user/auth system; I’d just have twitter take care of the “sign-in” part. I wouldn’t necessarily be using much from the twitter API beyond that, though it would obviously be available.

    # January 13, 2013 at 7:17 pm

    @traq I think it may be smarter to do that in case I switch to something else. I will already have the comments in a database. Any ideas on how to go about this?

    I’d obviously just have a login link that just authenticates (not authorizes) the user. I believe all I need is a single textarea field and some way to allow the user to edit their post. The form will be hidden by default until the user is authenticated. Or would I need some way of verifying the user?

    # January 13, 2013 at 10:54 pm

    Update: The author of Opauth is testing my code

    __
    # January 13, 2013 at 11:06 pm

    @chrisburton

    Are you asking about the login or the comment form or the database?

    Or all three

    (1) Don’t include the comment form at all if not logged in.

    (2) Every time you provide a form that’s tied to a specific user/action, it should have a token attached to it so you can validate that you gave the form to the particular user (recently).

    (3) I’d think the DB would need to store…

    … user.id of the comment author

    … date+time comment was authored

    … display status (show,hide,starred,buried,etc.)

    … comment thread id

    … the comment itself

    You’d need an extra field if you allowed users to comment on comments – the above would work for a simple list (ordered chronologically), but you’d need more if you wanted a tree structure.

    If you wanted to “version” comments (keep a record of edits), you’d need a field to track versions as well.

    # January 14, 2013 at 12:13 am

    I solved the Opauth issue myself. I only had to add my consumer key and secret into the config file and not into any other files like I was doing.

    # January 14, 2013 at 2:46 am

    @traq Hmm. Sounds complicated.

    > … user.id of the comment author

    This is to verify and target the user, correct?

    > … date+time comment was authored

    This could be used for displaying comments in a timely order.

    > … display status (show,hide,starred,buried,etc.)

    Not quite sure what I would do with this. Perhaps be able to delete comments?

    > … comment thread id

    This sounds like it’s for displaying the information on the correct blog post.

    > You’d need an extra field if you allowed users to comment on comments – the above would work for a simple list (ordered chronologically), but you’d need more if you wanted a tree structure.

    I will not be allowing this. If the user wants to reply to another user, @username that user.

    > If you wanted to “version” comments (keep a record of edits), you’d need a field to track versions as well.

    Not sure I’m understanding why I would need a separate field just for edits?

Viewing 15 posts - 31 through 45 (of 55 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag