Show HN: Hnwatch – Linux x64 terminal-based real-time HN watcher/reader
2ton.com.au
2ton.com.au
- it's apparently written in "FASM" assembler, which is BSD-licensed (according to Wikipedia), cross-platform, self-hosting (?), Intel-syntax (my preferred camp), and also has an experimental "g" version supporting output targetting JVM, AVR & other fancy stuff (customizable via "macroinstructions"): http://www.flatassembler.net/download.php
- IIUC, this "hnwatch" page is at the same time kinda delicate & non-pushy advertisement for the author's (authors'?) multipurpose ASM library named "HeavyThing" (i.e. kinda custom "stdlib"): https://2ton.com.au/HeavyThing/ (which seems to be required to build "hnwatch"? It wasn't clear to me initially) - worth some more highlight, I believe.
As a sideways wishful-thinking comment regarding the highlighter used for showcasing the hnwatch sources: I'd much prefer if syntax was not highlighted (i.e. the eye-piercing blue '[' & ']'), but instead the "call" instructions would, as well as "jmp" and variants (with a different colour), user symbols (different colour again) including especially labels (another colour please). Also, if there were somewhat more comments in the sources. Also, in https://2ton.com.au/library_as_html/hnwatch/textify.inc.html, the highlighter seems to have gone awry.
update: edited heavily to hopefully better express my positive attitude; in the Interwebs, no one can see you smile
Curious as to what your intention is by pointing out my investment in years of profit-free GPLv3 development, and that somehow that is tied to the BSD license of the compiler's creator.
Care to elaborate on a better method? I miss Turbo Assembler, which is in part what brought fasm into existence.
"Advertisement" for GPLv3 sources?
I am not ashamed to openly admit my company would love more contract work, consider what I have contributed for free the "world's most expensive curriculum vitae". I'm interested to hear what other open source decision makers have to say about this, but 2 Ton Digital as a Software resource has made me bupkiss.
More the point, when someone wants something that requires a higher-than-average level of skill, we get business. The community as a whole gets to benefit because I keep turning it loose with no strings attached. Isn't that the way it is supposed to work?
In other words, big thanks for making me aware of the FASM! Not sure if I'll ever use it, but totally worth remembering for future, just in case. Or, who knows; maybe for some hobby AVRing I hope to do it'd be actually easier than the whole AVR-GCC stuff?
If you want to run it: docker run -it agonzalezro/hnwatch
I don't know why but hnwatch doesn't look like working ATM. I've tried in a Linux box (without docker) and I have the same problem with the tty, it's just loading 4 news and no comments or similar.
Still, every interaction I have had with HN this year always results in lots of hosts getting said results, and while this one is going, the most offensive host: 207.226.141.203 (dns: 207-226-141-203.static.pccwglobal.net) .. 1800 requests and counting from that host... ??
[1] consider this a challenge...
secodns does sound cool :P Maybe a new project in the future?
I found a few of the key bindings by accident, trying to scroll with j. I considered making something like this a long while ago, but definitely not in asm, this is impressive.
I may have to poke at the code a bit and see if I can add/change a couple things :)
The list of articles then continues to be populated very slowly (I'm up to 12 now after a minute or so maybe?).
I've tried it on two different networks, one of them being 100/100mbit/s fiberoptics.
Am I missing something?
I do however get a coredump resizing the terminal window: Ubuntu 14.04LTS, tmux, hnwatch
Looking good so far.
:)
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;
}