10

GM 脚本:在 Disqus 中提示需要登录

 4 years ago
source link: https://blog.lilydjwg.me/2013/10/12/gm-script-remind-when-you-need-login-your-disqus-account.41050.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

GM 脚本:在 Disqus 中提示需要登录

本文来自依云's Blog,转载请注明。

Disqus 越来越受欢迎,然而,非 Disqus 用户评论越来越艰难

一开始,和 WordPress 一样,名字、电邮、网站。想要新评论通知?好呀,使用 Facebook、Twitter 或者 Google+ 登录下就好。

后来,「Twitter 用户,创建个 Disqus 帐号吧!」不想要 Disqus 帐号,那就不要登陆了,也甭想推广自己的博客,填上电邮地址显示个头像吧。当然,为了迫使你们登陆,名字和电邮信息也不像一般博客是记住的。下次继续填,继续勾选「以访客身份发布」。

现在,花了不少时间和心思写完很不错的评论,双击填名字的文本框填名字时,却经常发现刚展开的部分里那个「以访客身份发布」复选框没有了。「对不起,必须登录才能在此博客留言哦亲。」Holy shhhhhhhhhhhhhit!

此 GreaseMonkey 脚本为防止最后一种情况的发生,在你动手写下评论的时候明确告诉你不登录你的评论是发不出去的

不过,由于我现在取不到自己的 Disqus 帐号密码,所以不确定登录 Disqus 帐号之后这个脚本能否正确检测到。欢迎反馈!

点击安装

脚本全文如下:

disqus_login_reminder.user.js
// ==UserScript==
// @name        Disqus login required reminder
// @description Remind you if you can't post your comments because you aren't logged in
// @version     1
// ==/UserScript==
var check = function(){
var el = document.querySelector('input[name="author-guest"]');
if(!el){
setTimeout(check, 100, false);
return;
}
if(el.style.display == 'none'){
console.log("login required");
var msg = document.getElementsByClassName('placeholder')[0];
msg.textContent = '需要登录 / Login Required!';
msg.parentNode.addEventListener('blur', function(){
var msg = document.getElementsByClassName('placeholder')[0];
msg.textContent = '需要登录 / Login Required!';
});
}
};
setTimeout(check, 100, false);

点击安装


附:我始终认为,不管登陆评论能给用户和自己带来多大的好处,只要文章允许评论,来访者应当能够以最小成本发表评论并且署名。也就是,不需要注册,不需要登录,你就可以评论。最好支持 Gravatar 头像,最好支持链接到自己的网站,最好支持被回复时 Email 提醒。实际上本博客非登录用户需要填写验证码我已经很不爽了,只是 Chito 这个博客程序提供的另一种反垃圾策略——使用 Akismet——我这边已经坏掉了。

所以我越来越敬佩 WordPress。

发送到 Kindle


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK