Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 971859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:01:52+00:00 2026-05-16T03:01:52+00:00

I am looking for a very simple way to post status updates to a

  • 0

I am looking for a very simple way to post status updates to a dedicated Twitter account.

Currently we are using a POST request to https://api.twitter.com/1/statuses/update.xml with https basic auth. But Twitter is going to disable this API: http://apiwiki.twitter.com/Authentication

This oauth stuff is really, really complicated and not explained well at all.

I tried to use signpost but after playing around with that for hours, all I get is a 401.

OAuthConsumer consumer = new DefaultOAuthConsumer(consumerKey, consumerSecret, SignatureMethod.HMAC_SHA1);
consumer.setTokenWithSecret(accessToken, tokenSecret);

URL url = new URL("https://api.twitter.com/1/statuses/update.xml");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();

// Setup the header for the request
connection.setRequestMethod("POST");
connection.setRequestProperty("User-Agent", "Status Updater");

consumer.sign(connection);

// write the message
connection.setDoOutput(true);
OutputStream os = connection.getOutputStream();
os.write(("status=" + message.substring(0, Math.min(message.length(), 139))).getBytes("UTF-8"));
os.close();

// send the request
connection.getInputStream().close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:01:52+00:00Added an answer on May 16, 2026 at 3:01 am

    Seems like there is going to be a high demand for “simplifying” oauth for all the dedicated twitter accounts that use an external app. to post to a single account.

    For a full oauth cycle using signpost’s you’ll need to make three requests the first time, after that you’ll only need to make the last request to use your access token.

    Pulling some stuff from a test app. I wrote, your “quick and dirty” oauth code should look something like this…

    import java.io.BufferedReader
    import java.io.InputStreamReader
    import java.net.HttpURLConnection
    import java.net.URL
    
    import oauth.signpost.OAuth
    import oauth.signpost.OAuthConsumer
    import oauth.signpost.OAuthProvider
    import oauth.signpost.basic.DefaultOAuthConsumer
    import oauth.signpost.basic.DefaultOAuthProvider
    
    api_url = "http://twitter.com/statuses/user_timeline.xml"
    callback_url = "OOB"
    provider = new DefaultOAuthConsumer(key, secret);
    consumer = new DefaultOAuthProvider("http://twitter.com/oauth/request_token",
                             "http://twitter.com/oauth/access_token",
                             "http://twitter.com/oauth/authorize");
    
    auth_url = provider.retrieveRequestToken(consumer, callback_url);
    
    # Visit the auth_url and authorize that token manually
    
    # oauth_verifier should be the digits returned by twitter for OOB authorization
    
    provider.retrieveAccessToken(consumer, oauth_verifier);
    
    access_token = consumer.getToken()
    access_secret = consumer.getTokenSecrect()
    
    # Finally, make your request...
    
    url = new URL(api_url)
    
    connection  = url.openConnection()
    
    consumer.sign(connection)
    connection.connect()
    
    # In case you wanted to get the data/response.
    response = connection.getResponseMessage()
    
    reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))
    
    line = ''
    results = ''
    
    while ((line = reader.readLine()) != NULL) {
          results += line;
        }
    reader.close()
    

    I left the variable declarations off because I was using signpost through php (don’t ask), but all the API calls should be correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.