Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
UGH, DAMNIT
SUBMITTED BY:
Guest
DATE:
Oct. 17, 2013, 6:04 p.m.
FORMAT:
Python
SIZE:
736 Bytes
Raw
Download
Tweet
HITS:
1145
Go to comments
Report
import
urllib2
import
re
def
lookfor
(
string
,
url
):
file
=
urllib2
.
urlopen
(
url
)
text
=
file
.
readlines
()
for
line
in
text
:
if
re
.
match
(
"(.*)"
+
string
+
"(.*)"
,
line
):
print
line
;
else
:
print
"Line doesn't contain requested string."
file
.
close
()
done
=
False
while
(
done
==
False
):
userstring
=
input
(
"What string do you want to search for?"
);
userurl
=
input
(
"What URL do you want to search for?"
);
print
lookfor
(
userstring
,
userurl
);
finish
=
raw_input
(
"Are you finished? Y/N"
)
if
(
finish
==
"Y"
):
done
=
True
;
elif
(
finish
==
"N"
):
done
=
False
;
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus