We need the user to be able to enter URLs in our media section . However since users can make mistakes in entering the URLs , we need to ensure that the URLs are valid flickr URLs .
Valid URL eg :
http://www.flickr.com/photos/53067560@N00/sets/72157606175084388/
Invalid URL eg :
http://www.flickr.com/photos/53067560@N00/sets/12345/
Flickr offers API services , but I could not find one that would validate a URL .
The easiest way would be to make a HTTP HEAD request to the url, which would mean the URL is valid if it returns a HTTP response code of 200.
You could also use regex to ensure that it matches the expected pattern, which would possibly cut down the amount of requests you would have to make.