![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #2 (permalink) |
| Civilians | Viper wrote: > I need a program that will scan a page.. check that all URLs point to a > certain IP.. and if not will alert me to what ones dont.. If you want it, I can write it :-) -- John Perl SEO tools: http://johnbokma.com/perl/ Experienced (web) developer: http://castleamber.com/ Get a SEO report of your site for just 100 USD: http://johnbokma.com/websitedesign/seo-expert-help.html |
|
| | #3 (permalink) |
| Civilians | John Bokma wrote: > Viper wrote: > >> I need a program that will scan a page.. check that all URLs point >> to a certain IP.. and if not will alert me to what ones dont.. > > If you want it, I can write it :-) If I only had the cash hehe :P |
|
| | #4 (permalink) |
| Civilians | Viper wrote: > John Bokma wrote: >> Viper wrote: >> >>> I need a program that will scan a page.. check that all URLs point >>> to a certain IP.. and if not will alert me to what ones dont.. >> >> If you want it, I can write it :-) > > If I only had the cash hehe :P :-) If I was sure more people would want it, I might write it to put it on my Perl page. -- John Perl SEO tools: http://johnbokma.com/perl/ Experienced (web) developer: http://castleamber.com/ Get a SEO report of your site for just 100 USD: http://johnbokma.com/websitedesign/seo-expert-help.html |
|
| | #5 (permalink) |
| Civilians | Viper wrote: > I need a program that will scan a page.. check that all URLs point to a > certain IP.. and if not will alert me to what ones dont.. One does now (I was bored, this seemed interesting): #!/usr/bin/perl # Warning - quick and dirty! Might have errors in it. Untested on hostnames # that have multiple A records. # Perl for Windows from http://www.activestate.com/ # Perl comes with most common non-Windows systems, including most distros of # Linux, most flavours of BSD, and Mac OS X. # Distributed under the terms of the GPL # Usage: # perl different_ip.pl START_URL IP_ADDRESS # For example: # perl different_ip.pl http://www.example.com/ 192.168.0.1 use strict; use warnings; use HTML::TreeBuilder; use HTTP::Request; use LWP::UserAgent; use URI::URL; use Net: NS;die "You must specify a URL as the first command line parameter!" unless $ARGV[0]; die "You must specify an ip address as the second command line parameter!" unless $ARGV[1]; my $url = $ARGV[0]; my $ip = $ARGV[1]; my $ua = LWP::UserAgent->new(); $ua->agent('IPFinder/0.1 dorward@yahoo.com'); my $req = HTTP::Request->new(GET => $url); my $res = $ua->request($req); unless ($res->is_success) { die ( "Error " . $res->code ); } my $doc = HTML::TreeBuilder->new(); $doc->parse($res->content) or die($!); my $links = $doc->extract_links(); foreach my $link_el (@{$links}) { my $link = $link_el->[0]; my $uri = URI::URL->new($link, $url)->abs(); my $host = $uri->host(); my $dns_res = Net: NS::Resolver->new;my $dns_query = $dns_res->search($host); if ($dns_query) { my @addresses = (); foreach my $rr ($dns_query->answer) { next unless $rr->type eq "A"; my $address = $rr->address; push @addresses, $address; } if (scalar @addresses > 1) { print $uri->as_string . " resolves to more then one ip address\n"; } unless (grep(/$ip/, @addresses)) { print $uri->as_string . " does not resolve to $ip\n"; } } else { print "No IP Address Found for ", $uri->as_string(), "\n"; } } -- David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/> Home is where the ~/.bashrc is |
|
| | #6 (permalink) |
| Civilians | John Bokma <john@castleamber.com> wrote in news:Xns964EA4EDB8C1Fcastleamber@130.133.1.4: > Viper wrote: > >> I need a program that will scan a page.. check that all URLs point to a >> certain IP.. and if not will alert me to what ones dont.. > > If you want it, I can write it :-) > if you build it, he will come |
|
| | #7 (permalink) |
| Civilians | David Dorward wrote: > Viper wrote: > >> I need a program that will scan a page.. check that all URLs point >> to a certain IP.. and if not will alert me to what ones dont.. > > One does now (I was bored, this seemed interesting): > THANK YOU! THANK YOU! THANK YOU!!! ![]() |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Correct me if I'm wrong ( and I often am )...Doesnt MM own | Wheeler | Auto Racing | 3 | 04-29-2005 00:00 |
| this html doesnt make sense to me | Michael Z Blaney | Web Design | 1 | 02-05-2005 04:00 |
| Network Doesnt Work | Kyle O. | Microsoft Applications | 1 | 07-08-2004 07:32 |
| Change OIL LIGHT doesnt come on | Joseph A. Zupko | Automotive | 2 | 06-14-2004 20:23 |
| Change OIL LIGHT doesnt come on | Joseph A. Zupko | Automotive | 1 | 06-14-2004 16:21 |
![]() | ![]() | ![]() |