weicomment

1.1.3 • Public • Published

WeiComment

基于新浪微博的静态博客评论系统

使用

在需要评论的地方(例如 Hexo 模板中)添加 HTML

<div id="weicomment">
    <div class="loader"></div>
</div>
<style>
 
#weicomment .loader,#weicomment .loader:after,#weicomment .loader:before{background:#000;-webkit-animation:load1 1s infinite ease-in-out;animation:load1 1s infinite ease-in-out;width:1em;height:4em}#weicomment .loader{color:#000;text-indent:-9999em;margin:88px auto;position:relative;font-size:11px;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation-delay:-.16s;animation-delay:-.16s}#weicomment .loader:after,#weicomment .loader:before{position:absolute;top:0;content:''}#weicomment .loader:before{left:-1.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}#weicomment .loader:after{left:1.5em}@-webkit-keyframes load1{0%,100%,80%{box-shadow:0 0;height:3em}40%{box-shadow:0 -2em;height:3em}}@keyframes load1{0%,100%,80%{box-shadow:0 0;height:3em}40%{box-shadow:0 -2em;height:3em}}
</style> 
 
<script>
var t = document.createElement('script');
t.src = '//cdn.jsdelivr.net/npm/weicomment@latest/dist/js/weicomment.js?t=' + Math.floor(Date.now() / 1000 / 60);
 
t.id = 'weicomment-script';
t.setAttribute('data-uid', '你的微博 uid'); // 不知道 uid 的可以在 https://m.weibo.cn/ 搜索自己的 profile 页面,URL 中的 id 就是 uid
t.setAttribute('data-title', document.title.slice(2).split(' - ')[0]); // 获取当前文章的标题,根据自己的情况修改,WeiComment 根据标题寻找对应的微博,结果中不能包含空格等
document.head.appendChild(t);
</script> 

初始化一篇文章的评论

点击页面上的『分享微博初始化评论』,发布到微博后刷新页面即可初始化评论。注意不要修改分享的内容,WeiComment 根据标题匹配对应的微博评论。

评论管理

点进对应的微博进行管理即可

Readme

Keywords

none

Package Sidebar

Install

npm i weicomment

Weekly Downloads

28

Version

1.1.3

License

none

Unpacked Size

878 kB

Total Files

10

Last publish

Collaborators

  • xcodebuild