I’n trying to create an app where when I submit a form, it’ll tweet through everyone who has authorized my app. I’ve already set it up to work with my account, but I am using oauth keys. I was thinking perhaps I send users to a URL where a file is downloaded and they send it to me, or where they simply authorize the app and it will begin straight away.
Please help me! I am coding with PHP and using Abraham’s library.
It will Tweet the same text through multiple accounts? This is almost certainly a violation of our terms of service.
It wouldn’t duplicate tweets exactly, it would have a random number at the end. You can also select the tweet that would be tweeted in the admin panel (where the form is located)
Make sure you read https://support.twitter.com/articles/76915-automation-rules-and-best-practices and understand that on the surface it sounds like it would be very easy to be in violation of our spam policies with this kind of functionality.
No, what I’m trying to do does not violate this. So, could you help me?
You would need to follow the documentation to obtain oauth access tokens for each user: https://dev.twitter.com/docs/auth/oauth
Where abouts should I look? I need to know how when my visitors authorize an application, tweets are sent through their account too.
The “obtaining an access token” page would be a good start: https://dev.twitter.com/docs/auth/obtaining-access-tokens
Don’t send Tweets automatically when a user authorizes your application. A good rule to follow is “don’t surprise the user”, meaning they should be aware that your app will Tweet on their behalf.
https://dev.twitter.com/docs/api/1/post/statuses/update is the API method used to post a Tweet.
Okay, I get it. But now, how do I get the user to download the .txt file?
I’m not really sure what you mean. The Twitter API doesn’t offer any .txt files.
Someone has done this to me before, I’ve allowed them to tweet through my account. To do this, they sent me to an url in the site and a .txt file was downloaded, containing my oAuth token + secret.
Twitter’s API doesn’t offer the ability to download access keys as text, nor is it necessary to do so in order to authorize an application. You should read the documentation I linked to - it explains the process of obtaining and using OAuth keys.