9GAG使用什么评论小部件/系统?

时间:2015-02-03 13:40:36

标签: javascript php jquery comments

我想在我开发的新网站上使用评论系统,我非常喜欢9GAG正在使用的评论系统。以随机帖子为例:http://9gag.com/gag/aby5Ky9

我搜索了他们的源代码,检查了他们的javascript文件,但我根本找不到任何东西。或者他们自己建造了这个?

我更喜欢DisQus版本之上的这个。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

<script>
    var commentAuth = '';
    var retryCount = 0;
    window.pendingComment = {'url':'http://9gag.com/gag/aby5Ky9', 'commentType' : '9gag'};

    window.csAsyncInit = function() {
        if (!window.GAG) {
            retryCount++;
            if (retryCount < 20) {
                setTimeout(function(){window.csAsyncInit()}, 500);
                return;
            }
        } else {
            commentAuth = GAG.Configs.get('user.comment_auth');
            if (!commentAuth) {
                retryCount++;
                if (retryCount < 20) {
                    setTimeout(function(){window.csAsyncInit()}, 500);
                    }
                if (window.csAsyncInited == true) {
                    return;
                }
            }
        }
      window.CS2.init({
        'target' : 'jsid-comment-sys',
        'count' : 10,
        'appId' : 'a_dd8f2b7d304a10edaf6f29517ea0ca4100a43d1b',
        'host' : ( (commentAuth)? 'comment.9gag.com' : 'comment-cdn.9gag.com'),
        'apiHost' : 'comment.9gag.com',
        'cdnHost' : 'comment-cdn.9gag.com',
        'cross': 'http://9gag.com/proxy.html',
        'loginUrl' : 'https://9gag.com/login?next=http%3A%2F%2F9gag.com%2Fgag%2Faby5Ky9%23comment',
        'auth': commentAuth,
        'opClientId': '10917994',
        'opSignature': '04fccccf64bdc7f521800ce07344dd1defe42eda',
        'bucketId': '00078'
      });
      window.csAsyncInited = true;
      if (window.GAG) {
        window.GAG.PostController.renderPendingComment();
      }

    };

     (function(d, s, id){
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//assets-comment-lol.9cache.com/js/comment7.js";
          fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'comment-sdk'));
</script>

这是他们正在使用的起始脚本,但如前所述,这是一个由其他脚本支持的完整自定义脚本(我找到的唯一的是porthole.js)