Last active
August 9, 2018 15:36
-
-
Save flyfy1/5b5897976695576d951e792643704850 to your computer and use it in GitHub Desktop.
因为极客时间网页版上的专栏中,点开一篇文章在返回的时候,会重置上一个页面。这极大地影响了刷专栏的体验。这个脚本用来获取《极客时间》网页版的 标题、发布时间 和 连接,复制内容到剪贴版,用以直接粘贴进Excel / Google SpreadSheet 这样的程序
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This would get GeekTime Article in the format of: "title \t date \t links" | |
s = "" | |
document | |
.querySelectorAll(".article-item") | |
.forEach(function(n){ | |
s += ( | |
n.querySelector(".article-item-title").textContent + "\t" + | |
n.querySelector(".article-item-time").textContent + "\t" + | |
"https://time.geekbang.org" + | |
n.querySelector("a.article-item-more-text").getAttribute("href") + | |
"\n" | |
) | |
} | |
) | |
copy(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment