Generlize the script allowing custom minute interval, incoming and outgoing regex