1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

[bookmarks] Script to convert bookmarks from links2 to elinks

This commit is contained in:
jon 2024-03-13 10:32:17 +01:00 committed by Witold Filipczyk
parent 5db5d33911
commit d4b52d5bc4

View File

@ -0,0 +1,13 @@
#!/usr/bin/perl
# Usage example:
# ./links2elinks_bookmarks.pl < ~/.links2/bookmarks.html >> ~/.config/elinks/bookmarks
use 5.036;
while (<>) {
state $d = 0;
$d++ if m,^<DL>$,;
$d-- if m,^</DL>$,;
say "$1\t\t$d\tF" if m,<DT><H3>(.*)</H3>,;
say "$2\t$1\t$d\t" if m,<DT><A HREF="(.*)">(.*)</A>,;
}