News for hackers. Stuff that matters.
Re:Show HN: Hnwatch – Linux x64 terminal-based real-time HN ... by fascinated on Thursday July 16, 2015 @04:54AM (#9896063)
lynx
Re:Show HN: Hnwatch – Linux x64 terminal-based real-time HN ... by jrcii on Thursday July 16, 2015 @10:50AM (#9897551)
You could /almost/ have this with newsbeauter and lynx, except that the RSS feed doesn't include points or comment number and lynx doesn't indent comments, so all comments appear at the same thread level which is somewhat confusing.
Re:Show HN: Hnwatch – Linux x64 terminal-based real-time HN ... by profsnuggles on Friday July 17, 2015 @05:45AM (#9901932)
I use this in my elinks hooks.pl to indent hn comments.

    use strict;
    use warnings;
    
    use Encode;
    use Mojo::DOM;

    sub pre_format_html_hook {
        my $url = shift;
        my $html = Mojo::DOM->new(decode_utf8(shift));
    
        if ($url =~ 'news\.ycombinator\.com') {
            $html->find('img[src="s.gif"]')->each(sub { my $e = shift;
                                                        my $w = $e->attr('width');
                                                        my $ns = ' ' x ( $w / 10 );
                                                        $e->replace($ns); });
    }

    return $html;
}