#!/bin/sh ################################################################## ##Script Name: TWEET.SH ##Description: To tweet from Linux Command Line ##Author: Animesh Kumar (itsAnimesh) ##Version: 1.0.0 ##Author URL: http://itsAnimesh.com/ ##Contact Author: mail@itsanimesh.com ##This program is free software; you can redistribute it and/or ##modify it under the terms of the GNU General Public License ##as published by the Free Software Foundation; either version 2 ##of the License, or (at your option) any later version. ##This program is distributed in the hope that it will be useful, ##but WITHOUT ANY WARRANTY; without even the implied warranty of ##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##GNU General Public License for more details. ##You should have received a copy of the GNU General Public License ##along with this program; if not, write to the Free Software ##Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ##The full copy of the GNU General Public License is available here: http://www.gnu.org/licenses/gpl.txt ################################################################## ############EDIT THE FOLLOWING LINES...########################### user="USERNAME" pass="PASSWORD" ################################################################## ######################DO NOT EDIT BELOW THIS###################### tweet="${@}" if [ $(echo "${tweet}" | wc -c) -gt 140 ]; then echo "FATAL: The tweet is longer than 140 characters!" exit 1 fi curl -k -u ${user}:${pass} -d status="${tweet}" https://twitter.com/statuses/update.xml >/dev/null 2>&1 if [ "$?" == "0" ]; then echo "Successful tweet!" fi