Bulk hyperlink testing

Talk about anything at all....
Post Reply
rmcmeeking
Posts: 3
Joined: Sun Feb 17, 2019 7:34 pm

Bulk hyperlink testing

Post by rmcmeeking »

I have an online post on Wordpress that was written in OpenOffice Writer and is about 130 pages long. Each page averages 2 to 3 hyperlinks to source material. It is in HTML on Wordpress. The links work fine unless some of the linked material goes away, which happens. What I'd like to see is a one step process to find any links that are no longer valid. Simple, no?
OpenOffice 4.1.5 Win 10
YODA
Posts: 65
Joined: Fri Aug 10, 2018 4:06 am

Re: Bulk hyperlink testing

Post by YODA »

Openoffice4.16 on windows 10 Libreoffice Version: 6.1.3.2 (x64)
User avatar
robleyd
Moderator
Posts: 5036
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Bulk hyperlink testing

Post by robleyd »

Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
rmcmeeking
Posts: 3
Joined: Sun Feb 17, 2019 7:34 pm

Re: Bulk hyperlink testing

Post by rmcmeeking »

Thanks to both of you. I'll need to experiment some. But a process built into Writer should be preferable.
OpenOffice 4.1.5 Win 10
User avatar
Lupp
Volunteer
Posts: 3535
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Bulk hyperlink testing

Post by Lupp »

If all the links are in the bodytext of a text document opened in Writer, I would use something like the little Sub posted below. If you also need to treat hyperlinks anchored to TexPportions in cells of TextTables or in TextFrames, it's a bit more complicated.

Code: Select all

Sub showRemoveDeadLinks()
theDoc      = ThisComponent
theBodyText = theDoc.Text
For each para In theBodyText
  For Each piece In para
    hlU = piece.HyperLinkURL
    If hlU<>"" Then
      h = FileExists(hlU)
      If NOT h Then 
        piece.String = "[" & piece.String & "(" & hlU & ")dead" &"]"
        piece.HyperLinkURL=""
      End If
    End If
  Next piece
Next para
End Sub
===Edit 2019-02-18 01:42 (UCT + 1)===
I had to rectify the code a bit. The " h = ..." and the inner IF were not correctly placed. In consequence a "End If" was missing
(A short test of the Sub was done with LibO V 6.2.0.3 and with AOO V 4.1.5.)
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
rmcmeeking
Posts: 3
Joined: Sun Feb 17, 2019 7:34 pm

Re: Bulk hyperlink testing

Post by rmcmeeking »

I tried 3 tools found online. All of them test the html, not the source document. So on a site like wordpress it tests their stuff too. Several extraneous errors there. Here's my review.
**validator3 was very thorough, even identified redirected links. It gives the html line number and the bad link.
**Gizmo's "Best free website link checker" is a downloadable exe. It did not identify any link problems.
**www.deadlinkchecker.com/website-dead-link-checker.asp is my favorite. Very fast and identifies bad links and the hyperlinked text. Did not identify redirects.
OpenOffice 4.1.5 Win 10
User avatar
ThomasH
Posts: 15
Joined: Tue Feb 19, 2019 3:15 am
Location: Salt Lake City

Re: Bulk hyperlink testing

Post by ThomasH »

I'd be surprised to learn that Wordpress doesn't have a plugin to check for this built by someone in the community.

Yes; here's the first one that came up in my Google search: https://wordpress.org/plugins/broken-link-checker/
LibreOffice 6.0.7.3 on Ubuntu 18.04.1 LTS
Post Reply