This application implements this functionality for you:
Check the documentacion tab to see more details.