-
Notifications
You must be signed in to change notification settings - Fork 0
/
DaisyFind.sh
180 lines (149 loc) · 4.61 KB
/
DaisyFind.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# DaisyFind
# This program searches the Daisy stock of the DZB and DBB by keywords
# Copyright (c) 2017 Falk Rismansanj
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
echo ""
echo "*** Welcome to DaisyFind! ***"
echo "** Version: 1.0 by z1tr0t3c - http://zitrotec.de **"
echo ""
sleep 3
echo "--->> Checking Enviroment..."
echo -e "GET https://google.de HTTP/1.0\n\n" | nc google.de 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo ""
echo "--->> NETWORK: OK, Connected!"
else
echo ""
echo "--->> NETWORK: Failed! Please ensure you are online."
echo ""
exit
fi
command -v curl >/dev/null
if [[ $? -eq 0 ]]; then
echo ""
echo "--->> SYSTEM 1/2: OK, curl is installed!"
else
echo ""
echo "--->> SYSTEM 1/2: ERROR, please install curl first!"
echo ""
exit
fi
command -v links >/dev/null
if [[ $? -eq 0 ]]; then
echo ""
echo "--->> SYSTEM 2/2: OK, links is installed!"
echo ""
else
echo ""
echo "--->> SYSTEM 2/2: ERROR, please install links first!"
echo ""
exit
fi
echo -n "Type in the first name of the author for your searched daisybook ONLY ONE WORD --->> "
read k1
echo -n "Type in the last name of the author for your searched daisybook ONLY ONE WORD --->> "
read k2
echo -n "Type in ONLY ONE KEYWORD for your searched daisybook --->> "
read k3
echo ""
echo "--->> Searching for $k1 $k2 $k3 ..."
echo ""
echo ""
webserv="https://www.dzb.de/index.php?site_id=2.2.2.4&s=$k1+$k2+$k3"
if curl -s "$webserv" | grep "$k1 $k2 $k3"
then
echo ""
echo "--->> DZB: SUCESS, daisybook $k1 $k2 $k3 found!"
read -p "Do you want to open it now? [y/n] --->> " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo ""
echo "--->> You can close links with q."
sleep 3
links "https://www.dzb.de/index.php?site_id=2.2.2.4&s=$k1+$k2+$k3"
clear
webserv="http://www.katalog.blista.de/allegro/xnull/xnull/xnull/xnull/xnull/xnull/$k1+$k2+$k3/xnull/0000/xnull/25/0"
if curl -s "$webserv" | grep "keinen Treffer"
then
echo ""
echo "--->> DBB: ERROR, daisybook $k1 $k2 $k3 not found!"
echo ""
else
echo ""
echo "--->> DBB: SUCESS, daisybook $k1 $k2 $k3 found!"
read -p "Do you want to open it now? [y/n] --->> " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo ""
echo "--->> You can close links with q."
sleep 3
links "http://www.katalog.blista.de/allegro/xnull/xnull/xnull/xnull/xnull/xnull/$k1+$k2+$k3/xnull/0000/xnull/25/0"
echo "Bye!"
else
echo ""
echo "Bye!"
echo ""
exit
fi
fi
else
webserv="http://www.katalog.blista.de/allegro/xnull/xnull/xnull/xnull/xnull/xnull/$k1+$k2+$k3/xnull/0000/xnull/25/0"
if curl -s "$webserv" | grep "keinen Treffer"
then
echo ""
echo "--->> DBB: ERROR, daisybook $k1 $k2 $k3 not found!"
echo ""
else
echo ""
echo "--->> DBB: SUCESS, daisybook $k1 $k2 $k3 found!"
read -p "Do you want to open it now? [y/n] --->> " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo ""
echo "--->> You can close links with q."
sleep 3
links "http://www.katalog.blista.de/allegro/xnull/xnull/xnull/xnull/xnull/xnull/$k1+$k2+$k3/xnull/0000/xnull/25/0"
echo "Bye!"
else
echo ""
echo "Bye!"
echo ""
exit
fi
fi
fi
else
echo ""
echo "--->> DZB: ERROR, daisybook $k1 $k2 $k3 not found!"
echo ""
webserv="http://www.katalog.blista.de/allegro/xnull/xnull/xnull/xnull/xnull/xnull/$k1+$k2+$k3/xnull/0000/xnull/25/0"
if curl -s "$webserv" | grep "keinen Treffer"
then
echo ""
echo "--->> DBB: ERROR, daisybook $k1 $k2 $k3 not found!"
echo ""
else
echo ""
echo "--->> DBB: SUCESS, daisybook $k1 $k2 $k3 found!"
read -p "Do you want to open it now? [y/n] --->> " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo ""
echo "--->> You can close links with q."
sleep 3
links "http://www.katalog.blista.de/allegro/xnull/xnull/xnull/xnull/xnull/xnull/$k1+$k2+$k3/xnull/0000/xnull/25/0"
echo "Bye!"
else
echo ""
echo "Bye!"
echo ""
exit
fi
fi
fi