apt-get install bti
Now you have the command bti available on your shell and you have to complete the OAuth authorization process to be able to post on your twitter account.
First create your configuration file as:
# comments are allowed in the bti config file # rename this to ~/.bti so that you do not need # to constantly enter your account name and/or # password on the command line every time you send # a message. account="your account" password="your password" host=twitter # Example of a custom laconica installation #host=http://army.twit.tv/api/statuses logfile=.bti.log action=update #user="your proxy user" #proxy="http://your proxy address:port" #shrink-urls=yes
and put it in ~/.bti.
Consumer key and secret
You should register a new application to have access at your twitter following this link: https://twitter.com/apps/new.
- Application name: choose a different name from bti because that is already choosen.
- Website: http://gregkh.github.com/bti/
- client without callback
- Application type: Read and Write
Twitter will give you the two keys you need and You will put these at the and of your .bti config file as:
consumer_key=ambarabaciccicocco consumer_secret=trecivettesulcomò
Then try your first run:
$ bti
You will be prompted to browse a specific link and past back the pin you see. Then you will be asked to add other two rows in your configuration file and when you have done it, well all the process is completed! with the command:
$ echo "tweet what you want" | bti --debug
You will be able to tweet all you want from the shell!
Script
Create your Script file as:
#!/bin/bash
echo start: $(date) >> /var/log/bti.log
echo >> /var/log/bti.log
pausa=300
for line in $(seq $(wc -l tweets.txt | awk '{print $1}')); do
tail -n +$line tweets.txt | head -n 1 | bti --debug >> /var/log/bti.log
sleep $pausa
bti --action user --user $(tail -n +$line retweets.txt | head -n 1) | head -n 1 | sed 's/\[\(.*\)\]/RT @\1/' | bti --debug >> /var/log/bti.log
sleep $pausa
done
and put it in ~/tweets.sh
Create your tweets file as:
This is my first tweet using bti This is my second tweet Now a third one
and put it in ~/tweets.txt
Create your retweets file as:
myfavorytwitteraccount anothergreattweeteraccount
and put it in ~/retweets.txt







