Update twitter via curl as Function

tweet(){ curl -u "$1" -d status="$2" "http://twitter.com/statuses/update.xml"; }
Type the command in the terminal and press enter to create the tweet() function. Then run as follows: tweet MyTwitterAccount "My message goes here" It will prompt you for password. Make sure that you use escape "\" character in message for showing varialbles or markup.

0
By: Code_Bleu
2009-08-23 16:56:24

6 Alternatives + Submit Alt


  • 165
    curl -u user:pass -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml
    adamm9 · 2009-02-05 18:33:23 22
  • An improvement of the original (at: http://www.commandlinefu.com/commands/view/2872/update-twitter-via-curl) in the sense that you see a "from cURL" under your status message instead of just a "from API" ;-) Twitter automatically links it to the cURL home page. Show Sample Output


    14
    curl -u twitter-username -d status="Hello World, Twitter!" -d source="cURL" http://twitter.com/statuses/update.xml
    MyTechieself · 2009-12-08 14:54:33 1
  • Doesn't require password (asks for it instead) Show Sample Output


    11
    curl -u user -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml
    matthewbauer · 2009-08-05 02:24:01 2
  • This version of tweet() doesn't require you to put quotes around the body of your tweet... it also prompts you for password. It will still barf on a '!' character.


    7
    tweet () { curl -u UserName -d status="$*" http://twitter.com/statuses/update.xml; }
    bartonski · 2009-11-07 06:54:02 0
  • Found it on snipt, pok3, is it yours? I put my user = m33600, the password and the status was my robot message: Settima robot message: ALARM ZONE 3 (sent via command line). Now bots may have their identity on twitter... Show Sample Output


    2
    curl -u YourUsername:YourPassword -d status="Your status message go here" http://twitter.com/statuses/update.xml
    m33600 · 2009-06-27 21:47:48 6

What Others Think

This works great! anyway that you could make this into a .bashrc alias?
danstinebaugh · 580 weeks and 3 days ago
I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers find" rel="nofollow">http://personeriadebarranquilla.gov.co/?option=com_k2&view=itemlist&task=user&id=3107'>find this
bojokey283 · 19 weeks and 1 day ago
I love the way you write and share your niche! Very interesting and different! Keep it coming! read more
xoheko1229 · 19 weeks and 1 day ago
I love the way you write and share your niche! Very interesting and different! Keep it coming! read more
xoheko1229 · 19 weeks and 1 day ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. AC drive
bojokey283 · 17 weeks and 6 days ago
I love the way you write and share your niche! Very interesting and different! Keep it coming! coronavirus cancun
bojokey283 · 17 weeks and 5 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. carpet cleaning services
bojokey283 · 16 weeks and 6 days ago
I know your expertise on this. I must say we should have an online discussion on this. Writing only comments will close the discussion straight away! And will restrict the benefits from this information. cheap cloudlinux license
bojokey283 · 14 weeks and 5 days ago
Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. https://www.shopfloor-analytics.de/
bojokey283 · 14 weeks and 3 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. isla mujeres mexico
bojokey283 · 14 weeks and 1 day ago
Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post. schlüsseldienst köln
bojokey283 · 13 weeks and 6 days ago
If you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you. industrial chemical products
xoheko1229 · 12 weeks and 6 days ago
Please continue this great work and I look forward to more of your awesome blog posts. playa del carmen
bojokey283 · 12 weeks and 3 days ago
I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? yucatan cenotes map
xoheko1229 · 11 weeks and 1 day ago
I really needed this. Thanks. expert roofing Cairns
FLM76 · 11 weeks ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. rumah pintar
bojokey283 · 10 weeks and 3 days ago
I love the way you write and share your niche! Very interesting and different! Keep it coming! cozumel bar
xoheko1229 · 9 weeks and 5 days ago
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. Cozumel
xoheko1229 · 9 weeks and 3 days ago
I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! Papadzules
xoheko1229 · 9 weeks and 3 days ago
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. best area to stay in tulum
xoheko1229 · 9 weeks and 2 days ago
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. best restaurant in tulum mexico
xoheko1229 · 9 weeks and 1 day ago
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. tulum mayans
xoheko1229 · 9 weeks ago
Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. attractions in cancun
xoheko1229 · 8 weeks and 6 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. best all inclusive hotels in playa del carmen
xoheko1229 · 8 weeks and 6 days ago
This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!. isla mujeres cancun
xoheko1229 · 8 weeks and 4 days ago
Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. beaches in holbox
xoheko1229 · 8 weeks and 3 days ago
Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. best restaurant in holbox
xoheko1229 · 8 weeks and 3 days ago
I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.. best hotel holbox
xoheko1229 · 8 weeks and 3 days ago
I am definitely enjoying your website. You definitely have some great insight and great stories. treatnheal https://www.treatnheal.com/
xoheko1229 · 7 weeks ago
Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. treatnheal
xoheko1229 · 6 weeks and 5 days ago
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. Automatyka domowa
xoheko1229 · 6 weeks and 2 days ago
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. Automatyka domowa
xoheko1229 · 6 weeks and 2 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. bathroom vanity
bojokey283 · 5 weeks and 1 day ago
Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. tulum resorts all inclusive adults only
xoheko1229 · 4 weeks and 2 days ago
You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!. covid mexico
bojokey283 · 4 weeks ago
Nice knowledge gaining article. This post is really the best on this valuable topic. taroko gorge hikes
xoheko1229 · 3 weeks and 5 days ago
This is great information. Thank you for sharing it. roof repair Cairns
MaryJ27 · 3 weeks and 4 days ago
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Taiwan covid
bojokey283 · 3 weeks and 4 days ago
Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards, Mediterranean food catering near me
xoheko1229 · 2 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: