Here is an idea with a local apache server.
- Install Apache on your machine.
- Locate Apache access.log
- Watch the changes on this file with this command, and look after a specific string in the log: here, I am watching the access to my Drupal web application
Type this command in a terminal
$ tail -f access_log | awk '/drupal/ {system("/Applications/capture.app/Contents/MacOS/Application\\\ Stub");}'
Capture.app
is an automator application. It can be anything you want, for example:
$ system("say Drupal"); # speech synthesis
$ system("open -R /"); # opens the Finder
This is not a clean solution, it processes all the log when it starts, and it's attached to a terminal. Apache has mechanisms to do this with hooks.
You don't even have to have something at the URL. The only important part is the request in acces_log.