写了一个 chrome 浏览器用的 js 书签,功能是获取 V 站节点的 RSS 订阅页面网址

2016-10-24 00:45:50 +08:00
 zhangbohun

javascript:function getRssUrl() { var baseUrl = document.location.href.split("/")[2]; var urlType = document.location.href.split("/")[3]; if (baseUrl == 'www.v2ex.com' && urlType == 'go') { var theUrl = 'https://www.v2ex.com/feed/' + document.location.href.split("/")[4] + '.xml'; } else if (baseUrl == 'www.v2ex.com' && urlType == 't') { var theUrl = 'https://www.v2ex.com/feed/' + document.getElementsByClassName('header')[0].getElementsByTagName('a')[2].getAttribute('href').split("/")[2] + '.xml'; } else { alert('请在 V2EX 帖子或具体节点页面下使用。 —— zhangbohun'); return; } var theUrlDivNode = document.createElement("textarea"); theUrlDivNode.innerText = theUrl; theUrlDivNode.setAttribute("id", "this-page-url"); document.body.appendChild(theUrlDivNode); document.getElementById('this-page-url').select(); document.execCommand("Copy"); document.body.removeChild(document.getElementById('this-page-url')); window.open(theUrl);}getRssUrl();

功能如题。

话说还有人在用 RSS 的方式订阅博客之类的么?

2305 次点击
所在节点    分享创造
2 条回复
aixiaoge
2016-10-24 08:09:49 +08:00
有啊,用的 Inoreader
dynos01
2016-10-24 13:15:07 +08:00
有啊,看 rss 比开一大堆 app 方便多了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/314894

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX