Home > bash, linux, twitter > Tweet using bash!

Tweet using bash!

#!/bin/bash
# Store this file with whatever the name in /usr/local/bin/
# SYNTAX: twit Your_message_here
###### You cannot twit nothing! ####################
if [ -z “$1” ]
then
echo “Dude, enter some message, it can’t be blank! Come on!”
exit
fi
message=”$@”
####### Check the length to stop the request from failing #######
max_length=”140″
length=”${#message}”
echo “Message: ” $message
#echo $length
if [ $length -gt $max_length ]
then
echo “Dude, bada lamba message hai, only 140 chars allowed at a time…..It is a microblogging website, yes they are having shortage of space”
exit
fi
########## Enter your username password ##############
username=”username”
password=”password”
url=”http://twitter.com/statuses/update.xml”
curl –basic –user $username:$password –data status=”$message” $url

I wrote this small script which lets you twit through your terminal
Yes $HTTP_PROXY needs to be set

Enter your username and password in the file
and you are done!

PS: Yeah I know many such scripts exist! I never said this is new 🙂

Advertisements
Categories: bash, linux, twitter Tags: , , , ,
  1. AC
    November 19, 2009 at 8:13 pm

    You should be using https unless you want the whole insti to be posting updates to your account.

  2. November 20, 2009 at 8:37 am

    Hey, that was my entire plan. To sniff packets while other use this script of mine 🙂

    PS: Why would you hide your identity? 😛

  3. AC
    November 20, 2009 at 7:40 pm

    Isn’t the insti on a switched LAN? You may not be able to sniff packets unless you’re strictly upstream from the others.

    Netmon and others – however, are upstream from you.

    PS: why would I advertise my identity? 🙂

    • November 20, 2009 at 7:47 pm

      Yes, I have tried sniffing and it seems I can. Atleast in the same hostel for whom I can be their gateway programmatically 🙂
      PS: Yeah don’t need to advertise but it seems you are from Germany!! and that made me curious 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: