How to send a single tweet from a stand-alone-software (e.g. called in a MS-DOS-batchfile)?


#1

I want my own written dektop-application to send tweets on my programmed wish. I know about sending GET- or POST-Requests with HTTP (not HTTPS), I have routines to do BASE64-Encoding, but I don’t find documentation about just sendung a single tweet.

I don’t want to develop a whole application with timelines and so on. I just have my accout data (such as consumer key and consumer secret) and have my text of up to 140 characters, so I want to do a single tweet of this text from my stand-alone-program. What are the Parameters in the HTTP-Request to send a single tweet?


#2

You’ll need to:

  1. Create an application/API key here on dev.twitter.com to represent your “app” (a command line script that posts tweets): dev.twitter.com/apps – be sure and set your application as “read write” capable, since you’ll need to “write” (tweet)

  2. Use OAuth 1.0A or the built-in ability on dev.twitter.com/apps to create an access token. This represents your application’s relationship to a specific user account. In this case, the owner of the app and the user doing the tweeting are probably the same. If you want to use a different account to post through the same application, you would need to use OAuth 1.0A to negotiate that access token.

  3. Using the long-lived access token you obtained in Step 2, you write the actual script that will be performing the tweeting. You’ll need to use the consumer key and secret you got in step 1 (your API keys) and the access token and secret you got in Step 2 to sign requests to our [node:9703] method. OAuth 1.0A is the only form of auth allowed for this action, so that means you’ll probably want to use a third-party library for most of these steps, as they are relatively complex and error-prone.

Essentially, to tweet you need only send a “text” parameter to https://api.twitter.com/1.1/statuses/update.json – however, due to the auth component, you’ll also be sending a Authorization HTTP header containing the signed credentials that make that action valid.


#3

Tank you for this explanaition. I did not see that sending a tweet is done by a protocol named updating a status.

Do I really have to post to a HTTPS-address? I do not have SSL implemented in my code, so it would be must easier for me just to send text streams using HTTP.