Se siamo però utilizzatori di linux ed utilizzatori della shell' possiamo usare quest'ultima per aggiornare il proprio status.
Quello che ci occorre è la libreria cURL:
sudo apt-get install curlMentre lo script che andremo ad utilizzare è:
#!/bin/sh
user="user"
pass="password"
curl="/usr/bin/curl"
if [ "$LC_CTYPE" != "UTF-8" ]
then
echo "Converting from $LC_CTYPE to UTF-8 ..."
twit=$(echo "$@" | iconv -f "$LC_CTYPE" -t UTF-8)
else
twit=$@
fi
$curl --basic --user "$user:$pass" --data-ascii \
"status=`echo $twit | tr ' ' '+'`" \
"http://twitter.com/statuses/update.json" >& /tmp/stu$$
error=$(grep -i "Something is technically wrong" /tmp/stu$$)
if [ -n "$error" ]
then
echo "Something is technically wrong with Twitter. :-("
else
echo "Twitter updated. :-)"
fi
rm /tmp/stu$$
exit 0
E'da ricordare che questo script necessita di permessi per l'esecuzione e di conseguenza prima di utilizzarlo è necessario
chmod +x nome_file
Nessun commento:
Posta un commento