Post Comment Submit hook?

60 views
Skip to first unread message

Mike

unread,
Mar 5, 2010, 7:46:44 PM3/5/10
to DISQUS Developers
I'd like to do some things after a comment is posted. Just wondering
if there is a callback for that or perhaps I could attach an event to
the post button and that would be enough?

Thoughts or ideas?

Thanks!

Anton Kovalyov

unread,
Mar 5, 2010, 7:52:09 PM3/5/10
to disqu...@googlegroups.com
Hey Mike,

We do not have callbacks at the moment but I was thinking of implementing them. Could you describe what callbacks do you need and what information you need in there?

All, if you want to help us with suggestions, I'd appreciate. 

Thanks,
Anton


Mike Abner

unread,
Mar 5, 2010, 8:03:31 PM3/5/10
to disqu...@googlegroups.com
I was simply thinking of keeping a local count of the number of posts
for a particular thread. I know that i can call disqus with the api
and get the result, but it would be easier if I could simply be told
when a comment was successfully posted.

I'm experimenting with using the disqus_callback() method. Right now
I can use that to attach a click event to the dsq-post-button. I can
update a local post count when that happens, but i'm sure it will get
out of sync if posts don't go through or if they aren't submitted
successfully. For instance, if they are blank.

My issue is that i want to have a page that lists all my threads with
their post count. But i also want to weight them and order them based
on the number of comments. So I could query disqus every time this
page is loaded or i could simply update the post count when a comment
is submitted.

I'm thinking something as simple as:

disqus_new_comment_posted_callback(thread_id);

Ideally I'd like a way to pass you some kind of identifier so that i
don't have to query disqus again to figure out what url (and therefor
which local object) the thread_id maps to. Basically it would be
great disqus picked up a variable when constructing the POST request
that I could use to map it to a local db record.

disqus_new_comment_posted_callback(thread_id, object_id) //object_id
is something i pass to you and you pass back to me.

Those are my initial thoughts.

Mike

> --
> --
> http://groups.google.com/group/disqus-dev?hl=en

Mike

unread,
Mar 8, 2010, 8:02:24 PM3/8/10
to DISQUS Developers
Any ideas on this?

Anton Kovalyov

unread,
Mar 8, 2010, 8:47:52 PM3/8/10
to disqu...@googlegroups.com
Yeah. Right now we have the only function—disqus_callback—that fires after disqus is finished loading. I have plans to add more custom events but it will probably take some time.

I'll post updated on this group.

Anton


Reply all
Reply to author
Forward
0 new messages