Skip to content

Instantly share code, notes, and snippets.

@qiwihui
Last active September 28, 2018 02:30
Show Gist options
  • Save qiwihui/07a8bf3871ecbb6d1d95d9b7eef89f1a to your computer and use it in GitHub Desktop.
Save qiwihui/07a8bf3871ecbb6d1d95d9b7eef89f1a to your computer and use it in GitHub Desktop.
订阅 知乎专栏,简书和Medium
javascript: (
function () {
var u = 'https://www.inoreader.com/?add_feed=';
var l = location;
c = l.pathname.split('/')[1];
if (l.host == 'medium.com') {
u += l.protocol + '//' + l.host + '/feed/' + c;
} else if (l.host == 'zhuanlan.zhihu.com') {
u += l.protocol + '//' + l.host + '/' + c;
} else if (l.host == 'www.jianshu.com') {
cid = l.pathname.split('/')[2];
if (c == 'u') {
u += 'http://jianshu.milkythinking.com/feeds/users/' + cid;
} else if (c == 'c') {
u += 'http://jianshu.milkythinking.com/feeds/collections/' + cid;
} else if (c == 'nb') {
u += 'http://jianshu.milkythinking.com/feeds/notebooks/' + cid;
} else {
alert('not supported!');
return
}
} else {
u += l.protocol + '//' + l.host + '/feed';
}
if (confirm(u)) {
l.href = u;
// window.open(u, '_blank');
} else {
return
}
})()
@qiwihui
Copy link
Author

qiwihui commented Feb 6, 2018

javascript:(function(){var u='https://www.inoreader.com/?add_feed=';var l=location;c=l.pathname.split('/')[1];if(l.host=='medium.com'){u+=l.protocol+'//'+l.host+'/feed/'+c}else if(l.host=='zhuanlan.zhihu.com'){u+=l.protocol+'//'+l.host+'/'+c}else if(l.host=='www.jianshu.com'){cid=l.pathname.split('/')[2];if(c=='u'){u+='http://jianshu.milkythinking.com/feeds/users/'+cid}else if(c=='c'){u+='http://jianshu.milkythinking.com/feeds/collections/'+cid}else if(c=='nb'){u+='http://jianshu.milkythinking.com/feeds/notebooks/'+cid}else{alert("not supported!");return}}else{u+=l.protocol+'//'+l.host+'/feed'}if(confirm(u)){l.href=u}else{return}})()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment