DEV Community

Gernot Glawe
Gernot Glawe

Posted on

1

Check external links in PowerPoint automatically from the command line

How do I check whether all my external HTTPs links in the PowerPoints slides are OK? I asked chatgp.

The answer was not right, but it included the idea of just parsing the XML from powerpoint.

So it boiled down to simple steps:

1) Looking in directory ppt/slides/_rels/slide
2) Finding links with xmlquery

elements := xmlquery.Find(doc, "//Relationship")
Enter fullscreen mode Exit fullscreen mode

3) Do a

    response, errors := http.Get(web)
Enter fullscreen mode Exit fullscreen mode

And check it all:

 go run main.go check testdata/someuris.pptx
❌ Target https://www.john-doe.com/ is not reachable in slide: slide3
☑️ Target https://www.google.de/ is reachable in slide: slide3
❌ Target https://www.john-doe.com/ is not reachable in slide: slide2
☑️ Target https://www.google.de/ is reachable in slide: slide2
Enter fullscreen mode Exit fullscreen mode

Use the app: https://github.com/megaproaktiv/linkchecker
With binaries released: https://github.com/megaproaktiv/linkchecker/releases/tag/v0.1.4

Simple as that.
Enjoy!

For more good GO and AWS stuff:
https://www.go-on-aws.com/

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay