0

I am getting urls from a feed that I assign to list of buttons, some of the urls produce 404s when clicked on said buttons. Is there a way to check if the landing page exists first before I fire it?

Some of these urls have tracking pixels in them to know when they are clicked so I wouldn't want to fire it in an iframe or a similar solution as it would possibly track twice to test if it exist first before it fires.

Is this even possible? The domains will not be the same and I can't use jQuery.

user3612986
  • 315
  • 2
  • 7
  • 18

1 Answers1

1

To test an url you must access it. So, without an external service, you can't test them beforehand.

W3C provides a link checker: https://validator.w3.org/checklink "The program can be used either as a command line tool or as a CGI script." Maybe you can use it to test an url and, after, create or not your button.

I don't know if there is a limit for this service, so check the documentation! http://search.cpan.org/dist/W3C-LinkChecker/bin/checklink.pod

eebbesen
  • 5,070
  • 8
  • 48
  • 70