Citeam niste articole pe
lamp.ro si am dat din intamplare peste un 'articol' referitor la "updatarea statusului de twitter folosind cURL". Nu m-am putut abtine sa nu incerc si eu ceva. Rezultatul, il aveti mai jos.
#!/bin/bash
#script posted on [url=http://www.zapakitul.wordpress.com]www.zapakitul.wordpress.com[/url]
echo "Twitter Terminal :: Update twitter with your computer data."
while [ 1 ]
do
[ -f /proc/meminfo ] &MEMUSED="$(( ( ( ( $MemTotal - $MemFree ) - $Cached ) - $Buffers ) / 1024 ))"
MEMTOTAL="$(( $MemTotal / 1024))"
MEMFREE="$(( $MEMTOTAL - $MEMUSED ))"
MEMPER="$(( ( $MEMUSED * 100 ) / $MEMTOTAL ))"
echo "Commands: send, send_dm, brake, update.Memory"
read var_command
if [ $var_command == "update.Memory" ]; then
curl -u twitter_username:twitter_password -d status="Total memory: $MEMTOTAL mb, Unused memory: $MEMFREE mb, " http://twitter.com/statuses/update.xml;
fi
if [ $var_command == "send" ]; then
echo "Type jur tweet nao, mortal: "
read tweet
curl -u twitter_username:twitter_password -d status="$tweet" http://twitter.com/statuses/update.xml;
echo "Your tweet has been send"
fi
if [ $var_command == "send_dm" ]; then
echo "Receiver username: "
read receiver
echo "Message: "
read tweet
curl -u twitter_username:twitter_password -d user="$receiver" -d text="$tweet" http://twitter.com/direct_messages/new.xml
echo "Sent"
fi
if [ $var_command == "brake" ]; then
exit
fi
done