4
我知道這似乎是一個簡單的問題,但我發現沒有簡單的方法獲得ajax頁面中給定disqus標識符的評論計數。Disqus得到的評論計數
我已經看過他們的API,這是一種選擇,但我們正在爲最終用戶提供基於CMS AJAX網站,這似乎有點乏味,迫使每個用戶必須創建自己的自己的disqus應用程序API並填寫公開密鑰和祕密密鑰,以獲得評論數。此外,加載一個單獨的遠程JS,似乎矯枉過正,返回一個完整的JSON對象,只是爲了獲得當前頁面的評論數。
有一個count.js腳本here,但沒有關於如何動態更新ajax頁面計數的信息。幾乎...在經過大量搜索之後,我發現了一些未公開的方法DISQUSWIDGETS.getCount()。但是,在每個標識符的一次調用後,這將停止工作。此外,這種方法還需要加載一個外部JS只是爲了獲得評論數...
似乎奇怪的#comments數量不能被提取更容易。在評論顯示在頁面上之後,評論的數量仍然可用,但我們無法使用JS訪問該iframe。任何啓示是讚賞...
Disqus是我用過的最糟糕的服務之一。他們的API要麼不存在,要麼不工作,要麼只工作一次(!?!?!)。顯然'DISQUS.getCommentCounts()'對於他們來說太明顯了。 – AJB