const container = document.evaluate('//a', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE , null)
const items = Array.from(Array(container.snapshotLength).keys())
const _links = items.map(i => container.snapshotItem(i).innerHTML).filter(text => text.indexOf("http")!=-1)
const links = _links.sort().filter((e,i,a) => a.indexOf(e)==i)
console.log("Unique links \n" + links.join("\n"))
let map = {}
_links.sort().map(link => link.substring(0,100)).forEach(link => map[link] = (map[link] || 0) + 1)
Object.entries(map).sort(kv => kv[1]).map(kv => kv[1].toString().padEnd(4) + kv[0]).join("\n")
Created
April 4, 2018 15:37
-
-
Save mohanmca/481056956ca618a3b21a2b3a0d156f11 to your computer and use it in GitHub Desktop.
YcombinatorLinkCounter.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
copy paste the above code in console. (You can find console of the browser by pressing F12)