#!/usr/bin/perl -w # property search toy # Waider, January 2001 use LWP::UserAgent; use URI::Escape; $| = 1; my $debug = 0; $ua = new LWP::UserAgent; $ua->agent( "GeekToy/0.1 " . $ua->agent ); $ua->env_proxy(); # Need an EstateAgent object, supporting Search( location, type, price # ). Should return an object which contains a short description # (location, type, price) plus a hook back to the original site/more # detail page. $price = $ARGV[0] || 150000; sherry_fitz( $price ); #propertypartners( 150000 ); # Sherry Fitzgerald sub sherry_fitz { my ( $pr ) = shift; # Bits: [must get the rest of these] # bcode=0, for 'any branch' # price=150000 for up to 150,000 # tcode=1 for House # bedrooms=0 for any number of bedrooms # n2show=36 for number of properties to show # disact=show # acode=9 # rcode=1 # frow=1 # submit=submit # if disact = next, then that's for the next bunch of pages. my $base = "http://www.sherryfitz.ie/htm/res_prop/"; my $req = new HTTP::Request GET => $base . "display_results.whtm?rcode=1&acode=9&bcode=0&price=$ {pr}&tcode=1&bedrooms=0&n2show=36&disact=show&frow=1&submit=submit"; my $res = $ua->request( $req ); # Check the outcome of the response $res->is_success || die $res->as_string; print "Got initial list\n" if $debug; # Yay! my $page = $res->content; print $page if $debug == 2; $page =~ s/^.*?(\