how to automate pinteret pinning