K
K
kapitansen2015-01-23 14:43:32
API
kapitansen, 2015-01-23 14:43:32

Is it possible to display the number of hypercomments for a post preview?

It is necessary to display the number of comments in the announcements of articles in the blog. Comments on hypercomments.
I read here and here - my knowledge of javascript is not enough to realize how to bring all this to the desired form.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
at0m1x, 2017-12-27
@at0m1x

There are two ways:

  1. Get them on the backend via API: read
  1. Receive on the front using JS, an example with a regular form (but you can also send such a request through AJAX):
    <form method="post" action="http://c1api.hypercomments.com/api/comments">
        <input type="text" name="data" value='{"stream":"streamstart","widget_id":98339,"xid":"yii2-i18n","limit":1,"filter":"all"}'>
        <input type="submit">
    </form>

    In both cases, you need the "cm2" return parameter, which contains the number of comments in the article.
    But according to the second option, there is one "but", it is not documented in the official API, so now it works, but after a while it may stop working. But in the absence of it, it’s good and so)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question