Difference between revisions of "Snapshot API"

From Second Life Wiki
Jump to navigation Jump to search
(Added some advanced tips about snapshots.)
Line 114: Line 114:


The snapshot is a JPEG image. Postcards have two images, including a logo. The snapshot file name is always called "secondlife-postcard.jpg".
The snapshot is a JPEG image. Postcards have two images, including a logo. The snapshot file name is always called "secondlife-postcard.jpg".
== Advanced Snapshot Tips ==
There are a few tweaks that you can do in order to get the most out of taking snapshots within the Second Life client. Here are a few.
=== Multiple Addresses ===
The Recipient email field can accept multiple email addresses. You can separate each one with a semicolon.
account1@yourdomain.com;account2@yourdomain.com;account3@yourdomain.com
=== Populated Addresses ===
For those who always send snapshots to the same email addresses, you can edit a file on your file system to populate that information for you.
C:\Program Files (x86)\SecondLife\skins\default\xui\en-us\floater_postcard.xml
Look for the following and add your email addresses:
<nowiki><text bottom="-35" follows="top|left" font="SansSerif" left="12" name="to_label"></nowiki>
    Recipient&apos;s Email:
<nowiki></text></nowiki>
<nowiki><line_editor bottom_delta="-6" follows="left|top" height="20"</nowiki>
<nowiki>left="120" max_length="254" name="to_form"</nowiki>
<nowiki>width="150" ></nowiki>''account1@yourdomain.com;account2@yourdomain.com;account3@yourdomain.com''<nowiki></line_editor></nowiki>
=== Longer Messages ===
By default, the message is limited to 700 characters. You can extend this to 6,526 characters by editing a file on your file system.
C:\Program Files (x86)\SecondLife\skins\default\xui\en-us\floater_postcard.xml
Look for the following and change the max_length property:
<nowiki><text bottom_delta="-23" follows="top|left" font="SansSerif" left="12" name="msg_label"></nowiki>
    Message:
<nowiki></text></nowiki>
<nowiki><text_editor bottom_delta="-150" follows="left|top|right|bottom" height="140" left="12"</nowiki> ''max_length="700"'' <nowiki>name="msg_form" width="420"></nowiki>
    Type your message here.
<nowiki></text_editor></nowiki>

Revision as of 00:48, 17 January 2010

Getting Started

What is the Snapshot API?

The Second Life Snapshot API enables you to parse information from Snapshot emails sent from Second Life for:

  • Blogging
  • Social Networking
  • Image Libraries

Where is the Snapshot API used?

There are many websites that already use this information. Some of them are as follows:

Headers

Email messages have headers that provide metadata about the message itself. Most of this information is hidden from the person reading an email message. You can use some of this information to verify that the snapshot came from a Linden Lab server.

The following headers are available.

Parameter Data type Description
X-Originating-IP string IP of simulator. [216.82.41.11]
Subject string Subject of message
Sender string email address of www-data account on simulator. "www-data" <www-data@sim8938.agni.lindenlab.com>
From string Combination of address and name. Note: name is not always avatar name.
Date date Date of snapshot in Pacific timezone.

Details

The HTML content will contain details of the snapshot in a comment tag:

<!-- BEGIN POSTCARD DETAILS
agent_id=c4822e40-f763-4eec-bba3-e4bf842a074a
username="Dedric Mauriac"
region_id=714a15be-8511-4842-a8c1-38c1f54f3c58
sim_name="Applewood"
global_x=260282
global_y=235143
local_x=186
local_y=135
local_z=56
END POSTCARD DETAILS -->
Parameter Data type Description
agent_id key The UUID of the avatar that sent the message.
username string Quoted name of the avatar who sent the message.
region_id key The UUID of the region that the avatar was standing when the snapshot was taken.
sim_name string Quoted name of the region that the avatar was standing when the snapshot was taken.
global_x integer The grids horizontal location of where the avatar was standing when the snapshot was taken.
global_y integer The grids vertical location of where the avatar was standing when the snapshot was taken.
local_x integer The regions horizontal location of where the avatar was standing when the snapshot was taken.
local_y integer The regions vertical location of where the avatar was standing when the snapshot was taken.

Body

The body of the post card itself is identified with comments as well.

<!-- BEGIN POSTCARD BODY -->
test message
<!-- END POSTCARD BODY -->

Snapshot

The snapshot is a JPEG image. Postcards have two images, including a logo. The snapshot file name is always called "secondlife-postcard.jpg".

Advanced Snapshot Tips

There are a few tweaks that you can do in order to get the most out of taking snapshots within the Second Life client. Here are a few.

Multiple Addresses

The Recipient email field can accept multiple email addresses. You can separate each one with a semicolon.

account1@yourdomain.com;account2@yourdomain.com;account3@yourdomain.com

Populated Addresses

For those who always send snapshots to the same email addresses, you can edit a file on your file system to populate that information for you.

C:\Program Files (x86)\SecondLife\skins\default\xui\en-us\floater_postcard.xml

Look for the following and add your email addresses:

<text bottom="-35" follows="top|left" font="SansSerif" left="12" name="to_label">
    Recipient's Email:
</text>
<line_editor bottom_delta="-6" follows="left|top" height="20" 
left="120" max_length="254" name="to_form"
width="150" >account1@yourdomain.com;account2@yourdomain.com;account3@yourdomain.com</line_editor>

Longer Messages

By default, the message is limited to 700 characters. You can extend this to 6,526 characters by editing a file on your file system.

C:\Program Files (x86)\SecondLife\skins\default\xui\en-us\floater_postcard.xml

Look for the following and change the max_length property:

<text bottom_delta="-23" follows="top|left" font="SansSerif" left="12" name="msg_label">
    Message:
</text>
<text_editor bottom_delta="-150" follows="left|top|right|bottom" height="140" left="12" max_length="700" name="msg_form" width="420">
    Type your message here.
</text_editor>