> 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?
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.
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*?
@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.
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.
@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?
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.
@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?
You must be logged in to reply to this topic.