Skip to content

Instantly share code, notes, and snippets.

@shawwn
Last active June 9, 2021 00:14

Revisions

  1. shawwn revised this gist Jun 9, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion morehn.js
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,9 @@
    // ==/UserScript==

    /*
    How it looks: https://i.imgur.com/TtRGHFQ.png
    How it looks: https://i.imgur.com/AYV8O9T.png
    (Notice each 'more' link shows how many replies you'll see if you follow it.)
    Installation instructions:
  2. shawwn revised this gist Jun 9, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions morehn.js
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,8 @@ Installation instructions:
    - Replace it with this entire gist
    - Press Command-S to save. (Control-S, whatever. Make sure you actually save, otherwise it won't work.)
    - You should now see how many comments are waiting for you at each 'more' link
    */

  3. shawwn revised this gist Jun 9, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion morehn.js
    Original file line number Diff line number Diff line change
    @@ -30,5 +30,5 @@ Installation instructions:
    (function() {
    'use strict';

    [...byTag(document.body, 'a')].filter(x => x.innerText == 'more').map(x => { x.innerText = `${byClass($(x.href.split('item?id=')[1]), 'togg')[0].attributes['n'].value} more`; });
    [...byTag(document.body, 'a')].filter(x => x.innerText == 'more').map(x => { x.innerText = `${byClass($(x.href.split('item?id=')[1]), 'togg')[0].attributes['n'].value - 1} more`; });
    })();
  4. shawwn revised this gist Jun 8, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions morehn.js
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@
    // ==/UserScript==

    /*
    How it looks: https://i.imgur.com/TtRGHFQ.png
    Installation instructions:
    - Install tampermonkey: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
  5. shawwn created this gist Jun 8, 2021.
    32 changes: 32 additions & 0 deletions morehn.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    // ==UserScript==
    // @name More Hacker News
    // @namespace http://tampermonkey.net/
    // @version 0.1
    // @description Show descendant count on Hacker News 'more' links
    // @author Shawn Presser aka sillysaurusx (https://twitter.com/theshawwn)
    // @match https://news.ycombinator.com/*
    // @icon https://www.google.com/s2/favicons?domain=ycombinator.com
    // @grant none
    // ==/UserScript==

    /*
    Installation instructions:
    - Install tampermonkey: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
    - Go to hacker news
    - Click the tampermonkey icon (upper right)
    - Create new script
    - Replace it with this entire gist
    - You should now see how many comments are waiting for you at each 'more' link
    */

    (function() {
    'use strict';

    [...byTag(document.body, 'a')].filter(x => x.innerText == 'more').map(x => { x.innerText = `${byClass($(x.href.split('item?id=')[1]), 'togg')[0].attributes['n'].value} more`; });
    })();