4 @section Integration with Web pages
6 Simple HTML web page can be downloaded very easily for sending and
7 viewing it offline after:
10 $ wget http://www.example.com/page.html
13 But most web pages contain links to images, CSS and JavaScript files,
14 required for complete rendering.
15 @url{https://www.gnu.org/software/wget/, GNU Wget} supports that
16 documents parsing and understanding page dependencies. You can download
17 the whole page with dependencies the following way:
24 --restrict-file-names=ascii \
27 --execute robots=off \
28 http://www.example.com/page.html
31 that will create @file{www.example.com} directory with all files
32 necessary to view @file{page.html} web page. You can create single file
33 compressed tarball with that directory and send it to remote node:
36 $ tar cf - www.example.com | zstd |
37 nncp-file - remote.node:www.example.com-page.tar.zst
40 But there are multi-paged articles, there are the whole interesting
41 sites you want to get in a single package. You can mirror the whole web
42 site by utilizing @command{wget}'s recursive feature:
50 --no-parent [@dots{}] \
51 http://www.example.com/
54 There is a standard for creating
55 @url{https://en.wikipedia.org/wiki/Web_ARChive, Web ARChives}:
56 @strong{WARC}. Fortunately again, @command{wget} supports it as an
60 $ wget [--page-requisites] [--recursive] \
61 --warc-file www.example.com-$(date '+%Y%M%d%H%m%S') \
62 --no-warc-keep-log --no-warc-digests \
63 [--no-warc-compression] [--warc-max-size=XXX] \
64 [@dots{}] http://www.example.com/
68 That command will create @file{www.example.com-XXX.warc} web archive.
69 It could produce specialized segmented
70 @url{https://en.wikipedia.org/wiki/Gzip, gzip} and
71 @url{https://en.wikipedia.org/wiki/Zstandard, Zstandard}
72 indexing/searching-friendly compressed archives. I can advise my own
73 @url{http://www.tofuproxy.stargrave.org/WARCs.html, tofuproxy} software
74 (also written on Go) to index, browse and extract those archives