Is it possible to have a script that looks for a url with specific keywords when posted in a channel and then runs another program with that url as part of the input or a variable?

I know the /run command can open external programs - just not exactly sure how to use that with a variable input. Also I know the url filter will catch and list URLs posted but not sure if that would be useful for what I'm trying to do here.

If this is not clear let me know and I'll try to explain further.