Created
December 5, 2014 04:06
-
-
Save mikequentel/8449b69b411969444007 to your computer and use it in GitHub Desktop.
Bash Script Using wget to Update Twitter http://mikequentelsoftware.blogspot.ca/2009/11/bash-script-using-wget-for-twitter.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# BWTU (Bash-Wget-Twitter-Updater) | |
# DATE AND TIME. | |
CURRENT_DATE=$(date "+%A %Y%m%d %H:%M:%S") | |
UTC_DATE=$(date -u "+%A %Y%m%d %H:%M:%S") | |
# CD TO /var/tmp | |
cd /var/tmp | |
# READ IN LOGIN INFO. | |
echo -n "username: " | |
read -e USER | |
echo -n "password: " | |
stty -echo | |
read -e PASSWD | |
stty echo | |
echo | |
# WHILE LOOP -- CTRL+C TO BREAK. | |
echo "Enter ctrl+c to exit..." | |
while true; do | |
# READ IN STATUS COMMENT. | |
echo | |
echo -n "Enter status update to Twitter: " | |
read -e STATUS | |
# DO wget OF STATUS UPDATE TO TWITTER. | |
wget -O /dev/null -o /dev/null --http-user=$USER \ | |
--http-password=$PASSWD --post-data "status=$STATUS \ | |
-- $UTC_DATE UTC / $CURRENT_DATE LOCAL" \ | |
http://twitter.com:80/statuses/update.xml | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment