USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

Tweet from your bash shell.

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Shell Scripting and Programming
View previous topic :: View next topic  
Author Message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Fri Mar 12, 2024 1:49 am    Post subject: Tweet from your bash shell. Reply with quote

Follow me on my twitter account: http://twitter.com/bashscripts

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

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




_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
g33kb0ard3r
Jr. Member


Joined: 12 Jul 2024
Posts: 94
Location: Cedar Falls, IA

PostPosted: Sun Mar 14, 2024 3:15 am    Post subject: Reply with quote

Very cool, very cool.



_________________
Slackware 12.2
formerly Ubuntu 8.04
Back to top
View user's profile Send private message Send e-mail
VHockey86
Advanced Member


Joined: 12 Dec 2024
Posts: 988
Location: Rochester

PostPosted: Sun Mar 14, 2024 4:50 am    Post subject: Reply with quote

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



_________________
Main Desktops : Kubuntu 10.4. ArchLinux 64-bit. Windows7 64-bit. Windows XP 32-bit.

MacBook: OS X Snow Leopard (10.6)
Back to top
View user's profile Send private message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Wed Mar 17, 2024 4:06 pm    Post subject: Reply with quote

yeah....i probably should huh ? Smile



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
platinummonkey
Advanced Member


Joined: 01 Mar 2024
Posts: 732
Location: Texas

PostPosted: Tue Mar 23, 2024 1:05 am    Post subject: Reply with quote

please use https Wink

otherwise, you might find unwanted tweets lol



_________________
desktop - FreeBSD 7.2
laptop & server - Archlinux i686 kernel26 2.6.32.10-1
- TAMULinux-2.0.2-ALPHA
USB Boot - Archlinux i686 kernel26 2.6.32.10-1 USB boot
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Shell Scripting and Programming All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse