The best way to implement this would be to use the Twitter Composer, which also enables the user to choose their own text content (you can pre-fill this). Automatically Tweeting without the user’s permission, interaction or expectation is a bad user experience.