-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathrilconvert
More file actions
executable file
·26 lines (21 loc) · 795 Bytes
/
Copy pathrilconvert
File metadata and controls
executable file
·26 lines (21 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# (c) Vinzenz Vietzke <vietzke@b1-systems.de>
#
# ugly hack for importing readitlater to springpad:
# convert readitlater export files to delicious import format
#Ensure we have the quantity specified on the CLI
if [ -z "$2" ]; then ARG_ERR=ERR; fi
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "usage: rilconvert.sh input-filename.html output-filename.html"
exit
fi
echo -e "<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>" > $2
cat $1 | grep "<a href" | sed -e s/li\>/DT\>/g | sed -e s/time_added/ADD_DATE/g | sed -e s/tags/TAGS/g \
| sed -e s/'a href'/'A HREF'/g | sed -e s/TAGS/PRIVAT=\"0\"\ TAGS/g >> $2
echo -e "</DL><p>" >> $2