This question already has an answer here:

Based on some samples: http://www.commandlinefu.com/commands/view/176/update-twitter-via-curl

I'm trying to update my twitter status from command line (via cURL), but always get error. Any idea what I'm doing wrong?

curl -u <anonymized> -d status="#curl test" -d source="cURL" https://twitter.com/statuses/update.xml
Enter host password for user '<anonymized>':
<?xml version="1.0" encoding="UTF-8"?>
  <error code="34">Sorry, that page does not exist</error>

Or possibly, do you have an alternative solution for this (maybe not over cURL)?

marked as duplicate by Renan, manatwork, Anthon, slm, jasonwryan Jul 26 '13 at 19:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Is your ultimate goal to update twitter from a script or something? – Tim Jul 26 '13 at 14:22
  • well, the goal is to do so via linux command line – Peter Butkovic Jul 26 '13 at 14:27
  • 1
    I think my one liner answer should suffice for your needs. – Tim Jul 26 '13 at 14:59
  • The closest thing to curl for the Twitter API is twurl - OAuth-enabled curl for the Twitter API - I explained it in this answer in more detail. This question is closed so I can't post an answer here. – rsp Jun 8 '16 at 15:52

If you grab the perl script TTYtter you can make a post from the command line:

perl TTYtter -status="Hello World from Linux Shell #bash"

Run TTYtter once without any switches to setup the OAuth.

  • No prob! Glad it helped :) – Tim Jul 26 '13 at 18:41

As I said previously on comments, the Twitter OAuth API don't allow the use of POST for updating/tweeting status of Twitter accounts.

Your best bet is using one of the libraries already developed in most of the common languages that are included here, or creating an implementation yourself.

List of twitter libraries: https://dev.twitter.com/docs/twitter-libraries

Not the answer you're looking for? Browse other questions tagged or ask your own question.