爱意满满的作品展示区。
zhangbohun

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

  •  
  •   zhangbohun · Oct 24, 2016 · 2802 views
    This topic created in 3518 days ago, the information mentioned may be changed or developed.

    javascript:function getRssUrl() { var baseUrl = document.location.href.split("/")[2]; var urlType = document.location.href.split("/")[3]; if (baseUrl == 'www.sunp.eu.org' && urlType == 'go') { var theUrl = 'https://www.sunp.eu.org/feed/' + document.location.href.split("/")[4] + '.xml'; } else if (baseUrl == 'www.sunp.eu.org' && urlType == 't') { var theUrl = 'https://www.sunp.eu.org/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 的方式订阅博客之类的么?

    Supplement 1  ·  Jan 12, 2018
    javascript:function getRssUrl() { var baseUrl = document.location.href.split("/")[2]; var urlType = document.location.href.split("/")[3]; if (baseUrl == 'www.sunp.eu.org'&&; urlType =='go') { var theUrl ='https://www.sunp.eu.org/feed/' + document.location.href.split("/")[4] + '.xml'; } else if (baseUrl == 'www.sunp.eu.org'&&; urlType =='t') { var theUrl ='https://www.sunp.eu.org/feed/' + document.getElementsByClassName('header')[2].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();
    2 replies    2016-10-24 13:15:07 +08:00
    aixiaoge
        1
    aixiaoge  
       Oct 24, 2016
    有啊,用的 Inoreader
    dynos01
        2
    dynos01  
       Oct 24, 2016 via iPhone
    有啊,看 rss 比开一大堆 app 方便多了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5607 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 06:23 · PVG 14:23 · LAX 23:23 · JFK 02:23
    ♥ Do have faith in what you're doing.