14 lines
436 B
Bash
14 lines
436 B
Bash
#!/bin/bash
|
|
|
|
# Converts plain list of URLs to minimal HTML importable by most browsers.
|
|
# usage: bookmarks-convert-netscape.sh [input] [output]
|
|
|
|
echo -e '<!DOCTYPE NETSCAPE-Bookmark-file-1>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n<dl>\n\t<dt><h3>Bookmarks from Mastodon</h3></dt>\n\t<dl>' > $2
|
|
|
|
for url in `cat ${1}`
|
|
do
|
|
echo -e '\t\t<dt><a href="'${url}'"></a>' >> $2
|
|
done
|
|
|
|
echo -e '\t</dl>\n</dl>' >> $2
|