Tweeting about HUDDLES

Although, I haven’t been a user of twitter before, I got to thinking about how one might update a twitter stream from a LSL script in Second Life. It took me a little time to figure it out, but it seems quite easy. Someone posted a solution to the Second Life forums a couple years back.

The key line of code is this:

llHTTPRequest(“http://” + llEscapeURL(user) + “:”+llEscapeURL(password) + “”, [HTTP_METHOD, “POST”, HTTP_MIMETYPE, “application/x-www-form-urlencoded; charset=UTF-8”], “status=”+llEscapeURL(msg));

User is your twitter name, password is your password and msg is the message you want to send.

I’m thinking that it might be nice to add this to the EZ Animator Deluxe, but I’m wondering if anyone would use it and what features would they want. What do you think?

Oh, by the way, you can follow me on twitter, my name is KeikiAtHuddles.

Tags: , , , , ,

9 Responses to “Tweeting about HUDDLES”

  1. Rachel Kiranov Says:

    Hi Keiki, did you run that LSL? It didn’t work for me. I get a 401 Unsupported or unknown Content-Type and after half an hour the message still isn’t in Twitter. Perhaps something has changed since the code was published.

    I’d use it if you added it to the Huddles. I use Ordinal Malaprop’s Twitterbox but I’d rather carry one fewer thing. Ordinal’s works through a PHP script on her server, not directly to Twitter.

    I use it mostly to tweet prices and locations of things I find in stores, so I don’t forget about them. Ordinal’s script expands SLPOS and SLURL into the current location, which is very useful.

  2. Keiki Lemieux Says:

    Yep, I’ve definitely got that script working. Could you be more specific about the error you are getting? Is it when you compile the script? Or is it some feedback you are getting in the http_response event?

  3. Rachel Kiranov Says:

    It’s the HTTP response. Here’s my exact script (except for my username and password):

    string USER = “mytwittername”;
    string PASSWORD = “mytwitterpassword”;
    default {
    touch_start(integer total_number) {
    string msg = “this is a test from SL”;
    llHTTPRequest(“http://”+llEscapeURL(USER)+”:”+llEscapeURL(PASSWORD)+””, [HTTP_METHOD, “POST”, HTTP_MIMETYPE, “application/x-www-form-urlencoded; charset=UTF-8”], “status=”+llEscapeURL(msg));
    http_response(key request_id, integer status, list meta, string body) {
    llOwnerSay(“status:” + (string)status + ” meta:” + (string)llGetListLength(meta) + ” body:” + body);

    When I touch it, I see this in chat:

    twit: status:401 meta:0 body:Unsupported or unknown Content-Type.

  4. Keiki Lemieux Says:

    I tried your script. I got an error message. But it did post to my twitter.

    Object: status:415 meta:0 body:Unsupported or unknown Content-Type.

    IM me if you want me to give you a working script.

  5. Rachel Kiranov Says:

    Thank you Keiki. If the identical script worked for you, I figured it had to be something about my Twitter account. I made a new account and it works! I compared the settings of the two accounts and they’re identical, so who knows what is wrong with the old one. Anyway, now I can Twitter away happily 🙂

  6. Morrigan Says:

    Maybe you happen to have some special characters such as “_” or “-” in your username? Maybe that caused the error?

  7. Shomas Aabye Says:

    HTTP_MIMETYPE “application/x-www-form-urlencoded; charset=UTF-8?
    UPDATES but twitter still spits back
    “Unsupported or unknown Content-Type.”

  8. Keiki Lemieux Says:

    But does the tweet show up on your twitter page?

  9. Psyke Phaeton Says:

    The 415 error comes from the LL servers when they get the reply back from the remote server (Twitter). The LL server does not know how to handle the more exotic formats such as xml and json its reponse to us is the 415 error. We can assume therefore that the 415 error means Twitter replied, we will just never know what the reply was.

Leave a Reply

You must be logged in to post a comment.