Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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"?>
<errors>
  <error code="34">Sorry, that page does not exist</error>
</errors>

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

share|improve this question

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
add comment

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
that's great! it works for me, thanks. –  Peter Butkovic Jul 26 '13 at 18:39
    
No prob! Glad it helped :) –  Tim Jul 26 '13 at 18:41
add comment

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

share|improve this answer
add comment

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