How to get request token and set access token without manual intervention

I am trying to develop an application which can be scheduled to run daily during market hours but I am unable to find a way to automate the request token getting mechanism as all the examples that I saw requires manually getting the request token from the url and using it in the program to fetch the access token. It would be great if someone can help with the pointer to automate it or has already automated using python.
This discussion has been closed.