ソラマメブログ
プロフィール
ヒサノリ
ヒサノリ
ざりがに
アクセスカウンタ
QRコード
QRCODE
読者登録
メールアドレスを入力して登録する事で、このブログの新着エントリーをメールでお届けいたします。解除は→こちら
現在の読者数 0人
オーナーへメッセージ

2009年06月02日

スクリプトじゃなかったw

プロフィール画像の取得方法がわからなくてムキになったヒサノリですヽ(`Д´)ノ

調べてみたところ、

プロフィール画像を手に入れるスクリプトなど存在せず、

ウェブを利用してるらしいです。



まず、

llHTTPRequest("http://world.secondlife.com/resident/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", [ ], "");
(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxはアバターのUUID)
(二番目、三番目の引数は特に無くてok)

を実行すると、なんかデータが返ってくるので、

イベント

http_response(key request_id, integer status, list metadata, string body)

で取得します。

で、ここのstring bodyの中の

<img alt="profile image" src="http://secondlife.com/app/image/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/1" class="parcelimg" />

yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyyの部分がプロフィール画像のUUIDです。

string bodyを見るとわかるんですが、

情報(コメント部分)も見れるので、これも何かに使えそうです。

だらだら書きましたがこんな感じです。



(一応サンプル)

string url = "http://world.secondlife.com/resident/";
string str_target = "http://secondlife.com/app/image/";

key query = NULL_KEY;

default
{
touch_start(integer num_detected)
{
query = llHTTPRequest(url + (string)llDetectedKey(0), [], "");
}
http_response(key request_id, integer status, list metadata, string body)
{
if(request_id == query)
{
integer num_pos_target = llStringLength(str_target) + llSubStringIndex(body, str_target);
string uuid_texture = llGetSubString(body, num_pos_target, num_pos_target + 35);
llSetTexture(uuid_texture, ALL_SIDES);
llSetTimerEvent(5.0);
}
}
timer()
{
llSetTimerEvent(0.0);
key blank_texture = (key)"5748decc-f629-461c-9a36-a35a221fe21f";
llSetTexture(blank_texture, ALL_SIDES);
}
}

五秒で真っ白になります。

同じカテゴリー(図画工作)の記事画像
入店拒否
たこ焼き食べたい
ウエットティッシュ買ってくるの忘れた
バブ
ボールベアリング600円
角帽
同じカテゴリー(図画工作)の記事
 入店拒否 (2011-09-05 21:47)
 たこ焼き食べたい (2011-08-28 18:01)
 ウエットティッシュ買ってくるの忘れた (2011-05-01 20:29)
 バブ (2010-12-12 22:19)
 ボールベアリング600円 (2010-03-29 15:18)
 角帽 (2010-03-26 20:42)

Posted by ヒサノリ at 00:15│Comments(2)図画工作
この記事へのコメント
あーはー
そうなってたのね。
webサーバーから引っ張って来てたのかー
Posted by ein at 2009年06月02日 12:22
うん
なんかそうだったみたいw

そろそろhttpでも勉強しようかな?
Posted by ヒサノリ at 2009年06月02日 16:46
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。