Check a list of URLs

Our customer wants us to check a list of URLs (more than 100 links) every month, and see if some URLs are brokens. Most of the URLs link to our Notes pages in different Notes databases.

I’m wondering if I have a way to check all those URLs? I would like to put those URLs in a text file.

Thanks for your tiem,

Moke

Subject: Check a list of URLs

You can read from a URL using a java agent using the java.net.URL and java.io.inputSteam classes. For example, you could loop through your list of files, and attempt to read from each URL. If reading fails, you can log it. I don’t know of a way to do this in script.

Subject: RE: Check a list of URLs

Thanks, Paul.

Actually, I found your other related msg from this forum before you posted my question.

Could you please give me a sample? I’m not a Java developer, but I would like to learn some.

Thanks a lot.

Mike

Subject: RE: Check a list of URLs

I tried a small app using httpURLconnect class, and works perfectly.

Thanks.

Subject: Check a list of URLs

You can easily use LotusScript to traverse URLs within your applications. Here’s a starting point:

url = path & sdoc.universalid & "?opendocument"



Do While ie.busy

	Doevents

Loop

ie.navigate url

Do While ie.busy

	Doevents

Loop



body = ie.document.body.outerHTML

While Instr(Lcase$(body), "</body>") = 0

	body = ie.document.body.outerHTML

Wend

In addition you may check the image links and see if they’re valid. Just parse through the OuterHTML and collect the <img…> tags to get the information needed. Then try to get the image file and handle any errors accordingly.

Declare Function URLDownloadToFile Lib “urlmon” Alias “URLDownloadToFileA”(_

Byval pCaller As Long, _

Byval szURL As String, _

Byval szFileName As String, _

Byval dwReserved As Long, _

Byval lpfnCB As Long) As Long

Call URLDownloadToFile(0, url_of_image, dbase & "\" & ln & "\images\" & fname, 0, 0)

Enjoy,

Collin

KC8TKA

Subject: RE: Check a list of URLs

Collin:

Thanks for your info, and I will do some research first then try your suggestion.

Thanks,

Mike