GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Perl experts ? Here is another one... (https://gfy.com/showthread.php?t=579727)

CHMOD 02-23-2006 10:22 PM

Perl experts ? Here is another one...
 
I am slowly learning Perl... I can't figure out this one :

This link :

http://www.maxmind.com/app/ccv2r?i=2...CENSE_KEY_HERE

Returns a response on a webpage. A blank webpage with a string printed on the top of the page. It doesn't return a string.... It returns a webpage with a string printed on it.

Something like this :

distance=10;countryMatch=no;countryCode=US;freeMail=no; etc etc...

Now... What lines can pick up the answer of...let's say countryMatch ? ( On my example, the answer is "no" )

How can I pick up the answer of countryMatch and print it on my screen ?

:question

Thanks !

Spider Ninja 02-23-2006 10:25 PM

Code:

if (/countryMatch=([^;]+)/) {
    $match = $1;
}


Spider Ninja 02-23-2006 10:30 PM

well, something like:

Code:

#!/usr/bin/perl
use strict;
use LWP::Simple;

my $url = "http://www.domain.com/page.html";

my $html = get($url);

my $match;

if ($html =~ /countryMatch=([^;]+)/) {
    $match = $1;
}

print $match;


BusterBunny 02-23-2006 10:32 PM

http://library.thinkquest.org/26223/...ieroglyphs.jpg

CHMOD 02-24-2006 07:03 AM

Quote:

Originally Posted by Spider Ninja
well, something like:

Code:

#!/usr/bin/perl
use strict;
use LWP::Simple;

my $url = "http://www.domain.com/page.html";

my $html = get($url);

my $match;

if ($html =~ /countryMatch=([^;]+)/) {
    $match = $1;
}

print $match;




Awesome ! :bowdown


Thanks a lot ! :thumbsup

Spider Ninja 02-24-2006 08:10 AM

always happy when something works ;-)


All times are GMT -7. The time now is 02:43 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123