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 3624074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:27:44+00:00 2026-05-18T23:27:44+00:00

I’ve been looking for a way to update my Twitter status from a Python

  • 0

I’ve been looking for a way to update my Twitter status from a Python client. As this client only needs to access one Twitter account, it should be possible to do this with a pre-generated oauth_token and secret, according to http://dev.twitter.com/pages/oauth_single_token

However the sample code does not seem to work, I’m getting ‘could not authenticate you’ or ‘incorrect signature’..

As there are a bunch of different python-twitter library out there (and not all of them are up-to-date) I’d really appreciate if anybody could point me a library that’s currently working for POST requests, or post some sample code!

Update:
I’ve tried Pavel’s solution, and it works as long as the new message is only one word long, but as soon as it contains spaces, i get this error:

status = api.PostUpdate('hello world')
Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Python26\lib\site-packages\python_twitter\twitter.py", line 2459, in PostUpdate
        self._CheckForTwitterError(data)
      File "C:\Python26\lib\site-packages\python_twitter\twitter.py", line 3394, in _CheckForTwitterErro
    r
        raise TwitterError(data['error'])
    python_twitter.twitter.TwitterError: Incorrect signature

If however the update is just one word, it works:

status = api.PostUpdate('helloworld')
{'status': 'helloworld'}

Any idea why this might be happening?

Thanks a lot in advance,

Hoff

  • 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-18T23:27:45+00:00Added an answer on May 18, 2026 at 11:27 pm

    I’ve been able to solve this problem using another library – so I’ll post my solution here for reference:

    import tweepy
    # http://dev.twitter.com/apps/myappid
    CONSUMER_KEY = 'my consumer key'
    CONSUMER_SECRET = 'my consumer secret'
    # http://dev.twitter.com/apps/myappid/my_token
    ACCESS_TOKEN_KEY= 'my access token key'
    ACCESS_TOKEN_SECRET= 'my access token secret'
    
    def tweet(status):
        '''
        updates the status of my twitter account
        requires tweepy (https://github.com/joshthecoder/tweepy)
        '''
        if len(status) > 140:
            raise Exception('status message is too long!')
        auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
        auth.set_access_token(ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET)
        api = tweepy.API(auth)
        result = api.update_status(status)
        return result
    
    • 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.