|
-
Jan 6th, 2002, 04:36 PM
#1
Thread Starter
Fanatic Member
is this possible in perl?
can i retrieve the source for a website as a string? for instance could i have $google be the source for www.google.com/search?q=perl
??
FlameWave Technologies - internet tools
-
Jan 6th, 2002, 06:50 PM
#2
Stuck in the 80s
Yes, it is. How? I don't know. But I have seen scripts that download news from certain webpages to display it on theirs. So yes, it is possible.
-
Jan 7th, 2002, 04:24 AM
#3
Hyperactive Member
You can use the LWP::Simple module to do what you require!
However google have blocked this kind of request on their
'search' script (probbaly to stop people mirroring thier site).
Code:
#!/usr/bin/perl
use LWP::Simple;
$content = get("http://www.google.com/search?q=perl");
print $content;
Have a play about with the above script you'll find that if you use this on a server side script you will usually get whatever the script returns, not the actual script itself. But in the case of google thier script checks where the request is coming from and pumps out a forbidden page.
You can't download the actual script itself. Otherwise malicious people could find ways to crack your server!
For more info look up LWP::Simple on the search engines!!
-
Jan 7th, 2002, 04:14 PM
#4
Thread Starter
Fanatic Member
what do u mean u cant download the script itself? i thought web servers dont let u download actual cgi scripts only the pages that they return right?
FlameWave Technologies - internet tools
-
Jan 7th, 2002, 04:23 PM
#5
Frenzied Member
Provided they are correctly configured, you are correct.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jan 7th, 2002, 05:02 PM
#6
PowerPoster
how correctly configured?
-
Jan 7th, 2002, 05:13 PM
#7
Frenzied Member
*shrug* The server isn't supposed to give you the source for the CGI script.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jan 8th, 2002, 04:18 AM
#8
Hyperactive Member
what do u mean u cant download the script itself? i thought web servers dont let u download actual cgi scripts only the pages that they return right?
Exactly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|