Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 05-06-2005, 20:00   #1 (permalink)
Viper
Civilians

 
Default Bet it doesnt exist but Ill ask..

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..


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 05-06-2005, 20:00   #2 (permalink)
John Bokma
Civilians

 
Default Re: Bet it doesnt exist but Ill ask..

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
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-06-2005, 20:00   #3 (permalink)
Viper
Civilians

 
Default Re: Bet it doesnt exist but Ill ask..

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


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-06-2005, 20:00   #4 (permalink)
John Bokma
Civilians

 
Default Re: Bet it doesnt exist but Ill ask..

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
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-06-2005, 20:00   #5 (permalink)
David Dorward
Civilians

 
Default Re: Bet it doesnt exist but Ill ask..

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
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-06-2005, 20:00   #6 (permalink)
robert blake
Civilians

 
Default Re: Bet it doesnt exist but Ill ask..

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
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-06-2005, 20:00   #7 (permalink)
Viper
Civilians

 
Default Re: Bet it doesnt exist but Ill ask..

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!!!


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 11:38.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.92308 seconds with 19 queries