//put your Twitter username and password here
string twitter_user = "";
string twitter_pass = "";
updateTwitter(string update) {
if ((twitter_user != "") && (twitter_pass != "")) {
string url = "http://" + twitter_user +
":" + twitter_pass +
"@twitter.com/statuses/update.xml";
llHTTPRequest(url, [HTTP_METHOD, "POST",
HTTP_MIMETYPE,
"application/x-www-form-urlencoded"],
"status=" + llEscapeURL(update));
}
}
default {
state_entry() {
}
touch_start(integer num_detected) {
updateTwitter("Hello from LSL");
}
http_response(key request_id,
integer status,
list metadata,
string body) {
//always returns a 415 error
//unless it fails, in which case
//a 500 error is returned
}
}
Monday, May 14, 2007
Twittering from SL
I've read a number of blog posts by Ordinal Malaprop, Kisa Naumova and others about using Twitter from SL. Very cool stuff! The great thing about Twitter, from a scripting standpoint, is that if you just want to do updates from within Second Life, you can do it with just a few lines of LSL code and post directly to the Twitter servers. Here's a simple example that I hope you'll find useful:
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment