Lurker News

Comments (107) 36 threads

Show all comments

Showing thread 8 of 36

pmoriarty4 replies#
Any way this could be done without requiring javascript?

For security, ad-blocking, and privacy reasons I have javascript blocked in my browser, and really don't like to turn it on except for sites like my bank.

Jeaye#
This is a totally reasonable request and I was looking to say much the same thing. Anything resembling HN, or in the spirit of HN, shouldn't require JS to view, I think.
aplorbust#
"Any way this could be done without requiring Javascript?"

Could be done many ways.
Lets imagine you like text, you dont mind reading something somewhat structured and regular like json and you dont need all the html, css, etc. tags and window dressing.
5-minute quick and dirty solution
1. curl -4o 1.htm http://jsomers.net/hn/stories.json

    tr , '\12' < 1.htm \
    |exec sed '
    1i\

    /./{
    /{\"/,/}/!d;
    }
    /\"url\":[^{]/{s/\"url\":/&<\/pre>[FETCH]<\/a>
/;};
    /\"objectID\":/{s//&<\/pre>[FETCH COMMENTS]<\/a>
/;s/\"//3;s/\"//3;};
    s/{\"created_at\":/\
    \
    &/g;
    /}}}/s/$/\
    \
    -----------------/g;
    $a\
    <\/pre>

   ' > 2.htm
2. Navigate to file:///2.htm
shullbitt0r#
For security, noise blocking, and public unreasonableness I have only HN allowed in my browser, that is, if a site doesn't work without js, there's a high chance I don't want to read it. My bank page luckily doesn't need js either, to function.