Bulk hyperlink testing

Talk about anything at all....

Bulk hyperlink testing

Postby rmcmeeking » Sun Feb 17, 2019 8:39 pm

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
rmcmeeking
 
Posts: 3
Joined: Sun Feb 17, 2019 7:34 pm

Re: Bulk hyperlink testing

Postby YODA » Sun Feb 17, 2019 9:04 pm

Openoffice4.16 on windows 10 Libreoffice Version: 6.1.3.2 (x64)
YODA
 
Posts: 54
Joined: Fri Aug 10, 2018 4:06 am

Re: Bulk hyperlink testing

Postby robleyd » Sun Feb 17, 2019 11:13 pm

Cheers
David
Apache OpenOffice Developer Build 4.2.0 9820 - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 2714
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Bulk hyperlink testing

Postby rmcmeeking » Mon Feb 18, 2019 1:45 am

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
rmcmeeking
 
Posts: 3
Joined: Sun Feb 17, 2019 7:34 pm

Re: Bulk hyperlink testing

Postby Lupp » Mon Feb 18, 2019 1:52 am

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   Expand viewCollapse view
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 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2465
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Bulk hyperlink testing

Postby rmcmeeking » Tue Feb 19, 2019 12:26 am

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
rmcmeeking
 
Posts: 3
Joined: Sun Feb 17, 2019 7:34 pm

Re: Bulk hyperlink testing

Postby ThomasH » Fri Feb 22, 2019 12:39 am

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
User avatar
ThomasH
 
Posts: 14
Joined: Tue Feb 19, 2019 3:15 am
Location: Salt Lake City


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests