3 ms·
Text-only NYT test $# -eq 1 ||exec echo usage: $0 section \> news.htm a="GET /services/json/sectionfronts/$1/index.jsonp HTTP/1.1"; b="User
by feelin_googley 9y ago
Text-only NYT
test $# -eq 1 ||exec echo usage: $0 section \> news.htm
a="GET /services/json/sectionfronts/$1/index.jsonp HTTP/1.1";
b="User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36";
c="Host: static01.nyt.com";
d="Connection: close";
exec printf "%s\r\n%s\r\n%s\r\n%s\r\n\r\n" "$a" "$b" "$c" "$d" \
|exec openssl s_client -tls1_2 -ign_eof -connect static01.nyt.com:443 -servername static01.nyt.com -tlsextdebug -verify 9 \
|exec tr -cd '\12\40-\176' \
|exec sed -n '
/link\" :/{s/.* : \"//;s/\",//;s/.*/<a href=&>&<\/a><\/pre>/;};
/title\" :/{s/ > / Section: /; s/.* : \"/<br><pre>/; s/\",//;};
/lastBuildDate\" :/{s/.* : \"/<pre>/; s/\",//; s/\\n/<\/pre>/;};
/pre>/p;
'