News for hackers. Stuff that matters.
Re:The Quants Run Wall Street Now by 10165 on Sunday May 21, 2017 @08:00PM (#14389986)
I know there was just a discussion yesterday on how amp is awful but it still is useful, e.g., to read WSJ articles.

   curl -o 1.htm https://www.wsj.com/amp/articles/the-quants-run-wall-street-now-1495389108
   sed -n '/./{/<title/,/<\/title/p;/<p>/,/<\/p>/p;}' 1.htm > 2.htm
FWIW, 2.htm has no amp elements, no Javascript, no images, no ads, no externally sourced resources and therefore no tracking.

Add links to non-essential images (cf. auto-loaded by browser). With available captions.

  sed -n '
  /./{/div class=.image/,/<\/div/!d;s/ *//;}
  /src=/{s///;s/\"//g;s/.*/<a Href=&>&<\/a><br>/;}
  /alt=/{s///;s/[\">]//g;/./s/.*/<P>above: &<\/p>/;}
  /Href=/p;/<P>/p' 1.htm >> 2.htm
Re:The Quants Run Wall Street Now by nathan_f77 on Monday May 22, 2017 @12:42AM (#14391048)
Thanks very much for this script, it was really refreshing to read such a minimal webpage.

I added some bare-minimum CSS to make it a little nicer to read. Full command (with in-place sed):

    curl -o article.htm https://www.wsj.com/amp/articles/the-quants-run-wall-street-now-1495389108
    sed -n '/./{/<title/,/<\/title/p;/<p>/,/<\/p>/p;}' -i article.htm
    echo "<style>html { text-align: center; padding: 36px; } body { max-width: 600px; text-align: left; margin: auto; }</style>" >> article.htm
Re:The Quants Run Wall Street Now by PhantomGremlin on Sunday May 21, 2017 @08:33PM (#14390120)
This is excellent. Most times I'm willing to live with just the text.

The article had some pictures and graphs (see archive.li someone else posted). They were nice but they weren't essential.

Re:The Quants Run Wall Street Now by duckmuck on Sunday May 21, 2017 @11:03PM (#14390715)
Can you explain to me what I am looking at here? (curl -o 1.htm... >2.htm)? And how I can use it to view an AMP page?
Re:The Quants Run Wall Street Now by nl on Monday May 22, 2017 @12:09AM (#14390931)
It's two separate lines.

The first line uses curl to download the AMP file to 1.htm

The second line use sed to replace some elements in the HTML and writes it out to 2.htm

Re:The Quants Run Wall Street Now by zitterbewegung on Monday May 22, 2017 @12:07AM (#14390924)
It saves the page after the filtering that is done in the command and you can open the 2.htm to view the page.
Re:The Quants Run Wall Street Now by themodelplumber on Sunday May 21, 2017 @09:29PM (#14390341)
How is this different from using 'links' or 'w3m'?
Re:The Quants Run Wall Street Now by 10165 on Sunday May 21, 2017 @09:44PM (#14390385)
Using links is both better and easier.

amp html pages look great in links.

Re:The Quants Run Wall Street Now by taeric on Sunday May 21, 2017 @10:23PM (#14390543)
This made me wonder if it would render well in emacs using eww. Surprisingly well rendered, actually. Odd that it doesn't have any pictures. But easy to read.
Re:The Quants Run Wall Street Now by guiambros on Sunday May 21, 2017 @11:30PM (#14390820)
This is excellent, particularly for reading with lynx :)