←back to thread

384 points ingve | 1 comments | | HN request time: 1.054s | source
1. G_o_D ◴[] No.41879749[source]
Been doing so since 15 years, i make portable html with embedded images, mp3 and much so that i dont need any special software for viewing, just carry it in cloud or my phone nowadays and you only need a browser on any device any os. With embedded mp3 in html, (yes size may grew large) l, but i dont need special music player software or app just browser,

Nowadays along with html i try to archive using MHTML format instead of manually embedding

Run a simple http server and start browsing archives

FOR IMAGES I DO IS

---> Store all images in Folder

---> Open localhost server

---> Open folder in browser

---> Using javascript convert links to <img> tag with src=link

--> Once browser fetches and displays all images Save as and i have embedded MHTML archive

Or simple bash script can be used to create html with img tag and links to folder

Or you can manuaaly template a MHTML

BUT i let my browser do the heavy work why go manual,

Also instead of BASE64 EMBED, EMDEDDING DIRECTLY BINARY IMAGES IN MHTML IS QUITE MORE EFFECTIVE AND LESS MEMORY CONSUMING

Eg i have 15 images MHTML (binary encode) -> 4MB MHTML (BASE64 ENCODE) -> 5MB

Another method i use is, Run python -m http.server on any folder

Or linux : tree -H http://localhost:8000 Set recursion depth

Then open folder link from server or tree created HTML IN BROWSER

in cmd execute wget -rkpN -e robots=off http://localhost:8000

It will recreate folder with index.html for you to browse, you dont need server then for viewing

Same as export from google or twitter or youtube