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/

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up