Register
It is currently Thu Feb 22, 2018 12:44 am

Tweet from your bash shell.


All times are UTC


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Fri Mar 12, 2010 1:49 am   
Site Admin
User avatar

Joined: Thu Apr 17, 2003 3:44 am
Posts: 12300
Location: Iowa
Follow me on my twitter account: http://twitter.com/bashscripts

Tweet from your bash shell.
Change USERNAME and PASSWORD of course ;)

Code:
#!/bin/bash                                                                                                                 
# tweet. Crouse's bash tweeter for twitter.                                                                                 
read -p "Enter Your Tweet: " TWEET           
countme()
{
    count=`echo "$TWEET" | wc -m`;
    [[ $count -gt 140 ]] && echo "Tweet is $count characters, the maximum is 140 characters! Your TWEET was NOT sent!" && exit
}
countme
echo "SENDING ...."
curl -u USERNAME:PASSWORD -d status="$TWEET" http://twitter.com/statuses/update.xml -o /dev/null
echo "SUCCESS ! Your tweet was tweeted."
exit 0


_________________

Zbook (Laptop)- Mint 18 64-bit - I7-4800mq - 32GB ram
Phantom (Desktop)- Mint 64-bit - i7-5770 - 32GB ram
Nas4Free (NAS) - 6X3TB File Server.
Sky (HP BladeCenter) - 16 blades - 536 GB ram-G7/G6/G5 blades.


Top
 Profile WWW  
 PostPosted: Sun Mar 14, 2010 3:15 am   
Jr. Member

Joined: Sat Jul 12, 2008 10:19 pm
Posts: 97
Location: Cedar Falls, IA
Very cool, very cool.

_________________
Slackware 12.2
formerly Ubuntu 8.04


Top
 Profile  
 PostPosted: Sun Mar 14, 2010 4:50 am   
Sr. Member

Joined: Sun Dec 12, 2004 6:08 am
Posts: 1200
Location: Cupertino, CA
might be more efficient to just have the tweet as a quoted command line argument, kind of like a SVN commit comment?

Now go write the same thing in Python just for academic reasons :p


Top
 Profile  
 PostPosted: Wed Mar 17, 2010 4:06 pm   
Site Admin
User avatar

Joined: Thu Apr 17, 2003 3:44 am
Posts: 12300
Location: Iowa
yeah....i probably should huh ? :)

_________________

Zbook (Laptop)- Mint 18 64-bit - I7-4800mq - 32GB ram
Phantom (Desktop)- Mint 64-bit - i7-5770 - 32GB ram
Nas4Free (NAS) - 6X3TB File Server.
Sky (HP BladeCenter) - 16 blades - 536 GB ram-G7/G6/G5 blades.


Top
 Profile WWW  
 PostPosted: Tue Mar 23, 2010 1:05 am   
Advanced Member
User avatar

Joined: Thu Mar 01, 2007 3:59 am
Posts: 741
Location: Texas
please use https ;)

otherwise, you might find unwanted tweets lol

_________________
Archlinux, Debian, FreeBSD


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2012 phpBB Group
© 2003 - 2012 USA LINUX USERS GROUP