This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > December 2005 > Creating a URL still exists page/util





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Creating a URL still exists page/util
Laphan

2005-12-28, 6:38 pm

Hi All

Quite familiar with ASP and JavaScript and wondered if there is a method out
there that allows me to create a web page util to see if URL links are still
valid.

In other words I've created a system whereby a user can add their own
links/urls page, but they want to periodically check whether all of these
links by executing a multi-check.

My theoretical thought on this would be that the script would check if it
receives a 404 on each page request and mark a flag if and when it gets it,
but as to how I would do this in ASP or JavaScript, I have no idea.

Have you seen anything like this before?

Thanks

Laphan


Brian Wakem

2005-12-28, 6:38 pm

Laphan wrote:

> Hi All
>
> Quite familiar with ASP and JavaScript and wondered if there is a method
> out there that allows me to create a web page util to see if URL links are
> still valid.
>
> In other words I've created a system whereby a user can add their own
> links/urls page, but they want to periodically check whether all of these
> links by executing a multi-check.
>
> My theoretical thought on this would be that the script would check if it
> receives a 404 on each page request and mark a flag if and when it gets
> it, but as to how I would do this in ASP or JavaScript, I have no idea.
>
> Have you seen anything like this before?



No idea about ASP or JS, but trivial in Perl.

$ PERL -MLWP::UserAgent -e '$ua=LWP::UserAgent->new()
$res=$ua->get("http://www.example.org/");print $res->code . " " .
$res->message . "\n"'

200 OK

$ PERL -MLWP::UserAgent -e '$ua=LWP::UserAgent->new()
$res=$ua->get("http://www.example.org/broken-link.html");print $res->code .
" " . $res->message . "\n"'

404 Not Found



--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
Brian Cryer

2005-12-28, 6:38 pm

"Laphan" <info@SpamMeNot.co.uk> wrote in message
news:11r5hvoa1kbp753@corp.supernews.com...
> Hi All
>
> Quite familiar with ASP and JavaScript and wondered if there is a method

out
> there that allows me to create a web page util to see if URL links are

still
> valid.
>
> In other words I've created a system whereby a user can add their own
> links/urls page, but they want to periodically check whether all of these
> links by executing a multi-check.
>
> My theoretical thought on this would be that the script would check if it
> receives a 404 on each page request and mark a flag if and when it gets

it,
> but as to how I would do this in ASP or JavaScript, I have no idea.
>
> Have you seen anything like this before?
>
> Thanks
>
> Laphan


I'm quite sure you won't be able to do this with JavaScript.

You ought to be able to do it with ASP, but I'm not an ASP developer, and I
couldn't see any obvious links when I googled just now, but that probably
means I was using the wrong keywords to search on.

Something to consider: Why do this in ASP or JavaScript at all? Your basic
idea (of periodically checking links) is good (I do this on one of my
systems), but isn't this naturally an off-line activity? If you do this with
ASP it implies that it is being done in response to a web page request (and
waiting until you've verified the links before generating the page will be
very very slow.) If you treat it as an offline activity (i.e. one which is
done independently of any page requests) then you can use any programming
language you like, and either use the WinInet library or generate a direct
socket connection to get the server response.

So, excellent idea, but (personally) I think you're considering the wrong
tools.
--
Brian Cryer
www.cryer.co.uk/brian




John Bokma

2005-12-28, 6:38 pm

"Brian Cryer" <brian.cryer@127.0.0.1.ntlworld.com> wrote:

[ link checking ]
> I'm quite sure you won't be able to do this with JavaScript.


I'm quite sure you can, otherwise things like AJAX wouldn't be possible.

--
John PERL SEO tools: http://johnbokma.com/perl/
or have them custom made
Experienced (web) developer: http://castleamber.com/
Brian Cryer

2005-12-28, 6:38 pm


"John Bokma" <john@castleamber.com> wrote in message
news:Xns973A898CAA984castleamber@130.133.1.4...
> "Brian Cryer" <brian.cryer@127.0.0.1.ntlworld.com> wrote:
>
> [ link checking ]
>
> I'm quite sure you can, otherwise things like AJAX wouldn't be possible.


Thanks John. I stand corrected (and educated - I wasn't aware of AJAX
before). It looks like you CAN do this with JavaScript. Example (one of many
I'm sure) at http://developer.apple.com/internet...xmlhttpreq.html
--
Brian Cryer
www.cryer.co.uk



William Tasso

2005-12-28, 6:38 pm

Writing in news:alt.www.webmaster,freeserve.webspace.authoring
From the safety of the Posted via Supernews, http://www.supernews.com
cafeteria
Laphan <info@SpamMeNot.co.uk> said:

> Hi All


How do you do?

> Quite familiar with ASP and JavaScript and wondered if there is a method
> out
> there that allows me to create a web page util to see if URL links are
> still
> valid...



ServerXMLHTTP:
http://support.microsoft.com/defaul...b;en-us;Q290761

or, for client side use research: XMLHTTP

--
William Tasso

Save the drama
for your Mama.
John Bokma

2005-12-28, 6:38 pm

"Brian Cryer" <brian.cryer@remove.127.0.0.1.this.ntlworld.com> wrote:

>
> "John Bokma" <john@castleamber.com> wrote in message
> news:Xns973A898CAA984castleamber@130.133.1.4...
>
> Thanks John. I stand corrected (and educated - I wasn't aware of AJAX
> before).


Where have you been? I mean, AJAX is the hype of 2005 :-D

--
John PERL SEO tools: http://johnbokma.com/perl/
or have them custom made
Experienced (web) developer: http://castleamber.com/
David Dorward

2005-12-28, 6:38 pm

John Bokma wrote:
> "Brian Cryer" <brian.cryer@127.0.0.1.ntlworld.com> wrote:
> [ link checking ]
[color=darkred]
> I'm quite sure you can, otherwise things like AJAX wouldn't be possible.


If you use AJAX for that then you are limited to the domain that the page is
coming from, and you have to ask the user's browser to hit your server for
every link you want to check. It would be *far* faster and easier to do
this server side.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
John Bokma

2005-12-28, 6:38 pm

David Dorward <dorward@yahoo.com> wrote:

> John Bokma wrote:
>
>
> If you use AJAX for that then you are limited to the domain that the
> page is coming from, and you have to ask the user's browser to hit
> your server for every link you want to check. It would be *far* faster
> and easier to do this server side.


Of course. But it's not impossible :-) Also, with a small server side
script you can jump outside the domain, and with AJAX you can make a nice
incrementally updated webpage:

link 1 - ok
link 2 - not working
link 3 - working...
link 4 - todo
etc.

If there are a lot of links to be checked, I would probably use the latter
if the visitors want to have something to look at real time.

--
John PERL SEO tools: http://johnbokma.com/perl/
or have them custom made
Experienced (web) developer: http://castleamber.com/
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews