38 |
file=`echo $url | sed -e s,http://[^?]*?,index.html?, -e s,#.*$,, -e s,/,%2F,g` |
file=`echo $url | sed -e s,http://[^?]*?,index.html?, -e s,#.*$,, -e s,/,%2F,g` |
39 |
if [ -e "$file" ] ; then |
if [ -e "$file" ] ; then |
40 |
# echo "skip $url" |
# echo "skip $url" |
41 |
|
echo -n "." |
42 |
return |
return |
43 |
fi |
fi |
44 |
|
|
69 |
sed -e 's/^.*<a.*href="//i' \ |
sed -e 's/^.*<a.*href="//i' \ |
70 |
-e 's/".*//' -e 's/amp;//g' \ |
-e 's/".*//' -e 's/amp;//g' \ |
71 |
-e 's,^[^\?]*\?,http://safari.oreilly.com/,' \ |
-e 's,^[^\?]*\?,http://safari.oreilly.com/,' \ |
72 |
-e 's/#$//' \ |
-e 's/#.*$//' \ |
73 |
-e 's/\&srchText=//' \ |
-e 's/\&srchText=//' \ |
74 |
-e 's/open=false/open=true/' | \ |
-e 's/open=false/open=true/' | \ |
75 |
grep '&s=1&b=1&f=1&t=1&c=1&u=1&r=&o=1' | \ |
grep '&s=1&b=1&f=1&t=1&c=1&u=1&r=&o=1' | \ |
82 |
mv in in.tmp |
mv in in.tmp |
83 |
grep -v 'view=[A-Z]' in.tmp | sort -u > in |
grep -v 'view=[A-Z]' in.tmp | sort -u > in |
84 |
grep 'view=[A-Z].*/index' in.tmp | sort -u >> in |
grep 'view=[A-Z].*/index' in.tmp | sort -u >> in |
85 |
|
links=`wc -l in | cut -d" " -f1` |
86 |
|
echo "found $links unique links" |
87 |
} |
} |
88 |
|
|
89 |
function mirror_in() { |
function mirror_in() { |
111 |
exit 1 |
exit 1 |
112 |
fi |
fi |
113 |
done |
done |
114 |
|
echo |
115 |
} |
} |
116 |
|
|
117 |
echo -n > in |
echo -n > in |
118 |
mirror "http://safari.oreilly.com/?XmlId=$isbn" |
mirror "http://safari.oreilly.com/?XmlId=$isbn" |
119 |
|
echo |
120 |
|
|
121 |
echo "extract URLs from first page..." |
echo "extract URLs from first page..." |
122 |
geturl "index.html?XmlId=$isbn" $isbn |
geturl "index.html?XmlId=$isbn" $isbn |