Twitter APIs: looks cool..

Printer-friendly versionPrinter-friendly version
Twitter Logo

Non so perchè, ho deciso di provare 'sto Twitter..
La cosa divertente però sembrano essere le API per l'accesso da qualunque tipo di applicazione..

La documentazione dettagliata è qui: http://apiwiki.twitter.com/Twitter-API-Documentation

Divertente è la possibilità di creare scriptini per eseguire velocemente azioni, tipo postare un update o inviare un messaggio privato..

update_status.sh

1
2
3
4
5
6
#!/bin/bash
 
if [ "$1" != "" ]; then
        curl -u "$( cat ~/.twitter-login )" -d "status=$1" http://twitter.com/statuses/update.xml
else
        echo "Usage $0 message"

priv_msg.sh

1
2
3
4
5
6
7
#!/bin/bash
 
if [ "$2" != "" ]; then
        curl -u "$( cat ~/.twitter-login )" -d "text=$1&user=$2" http://twitter.com/direct_messages/new.xml
else
        echo "Usage $0 message dest"
fi

..ma prima di tutto date un bel:
echo "username:password" > ~/.twitter-login
per salvare i dati per l'autenticazione

ovviamente, è possibile roba molto più complessa, che legga anche informazioni usando l'XML restituito, ecc..

sto pensando a un modulo per Drupal che invii su twitter varie azioni, es. la creazione di un nuovo post.

Who Am I?

~redShadow~ A.K.A. Samuele Santi is an Italian Open Source developer, currently working as a freelance developer, mainly in the web applications sector. Favourite programming languages: PHP and, of course, Python!

3d (3) C++ (2) cartoons (1) bash (11) documentation (2) doku (1) cars (1) caos (1) como lake rovers (1) dmcrypt (1) Drupal (21) debug (1) camera mia (1) debian (1) code (3) address book (2) alcool (1) aircrack (1) blender (3) apt (1) development (11) cocktails (1) algorythms (1) awstats (3) 2v (1) curl (1) arduino (1) archive (1) blogroll (7) citroen (1) contact manager (1) circuits (1) e-mail (2) apache (1) database (3) audio (1) backup (3) cryptography (1) aoe (1) Drupal Forms (1)