Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Linking in-world with web services

Sterling Silverfall
Registered User
Join date: 2 Apr 2009
Posts: 2
04-02-2009 12:45
I would like to take information input in-world and save it to an out-of-world web service. I would also like users to be able to view information gathered from a web service in-world. I have looked at prims, LSL, XMLHttpRequest, Notecards, HUDs, etc. and Bots. So I have read enough to be able to communicate and don't have the experience to really judge the best way to accomplish this.


Displaying information :

1. One way might be to create a HUD that looks for special prims that have timed updates to pull info from the web service or use a bot interface to push the updates into prims.

2. Another might be to invoke the the browser from an in-world prim where there several menu items to allow for url's with ?params=

Which is best? Are there others?


Saving information :

I have seen various interfaces in SL including a land owner survey but haven't found any information on to get forms style data from the user. WRT to saving I assume that XMLHttpRequest is the method of choice.

Would it be possible to develop a model where users drop info on a prim and use a bot to collect it?

Any pointers would be greatly appreciated.

Cheers,
Sterling
Amelia Marikh
Registered User
Join date: 27 May 2008
Posts: 4
04-05-2009 14:21
have looked at the parrot scripts?
Lily Cicerone
Registered User
Join date: 25 Jan 2007
Posts: 30
04-06-2009 13:55
You haven't made clear exactly what you're trying to do. I'm assuming you're looking to gather survey data. There's no "best way" to do this, or it depends, at any rate, on the type of data you're trying to collect. In general, the model I would recommend would work something like:

First, you'd create a web page with a form for the data you want to gather from the user. The form would not need to collect their in-world name or anything like that, but you would want fields for all the data you're trying to gather. Just imagine this as a simple web page for now -- don't worry about the back end script.

Ok, now you need a way to gather the user's name and key as you display this form to them. To do this in world, you'd start with a prim and on on_touch event. When the user touches the prim, a script sends an http request to a .php or .aspx script hosted on a remote server. The script inside the prim would send an http request including the name and key of the user who touched it. The .php script would receive this data, drop it into a database (mySQL or MSSQL, probably), along with a unique key. The in-world script would receive the unique key and use it to generate a link.

Ok, now that simple form? Now you'd need to apply some server-side scripting. Assuming you're using .php, the form page needs to be able to retrieve GET data to determine the unique id of this visit. In other words, if Hubert Mann clicks the prim and the remote script creates a database entry for him under the unique id 12345, the remote script then sends the unique id back to the in-world script, which would generate a link that would look something like www.yourserver.net/formscript.php?id=12345

Now, when Hugh fills out the form, he doesn't need to include his in-world name, because the form already knows to drop the information into the database entry with the unique id 12345, which is registered to Hugh's account.

This may sound complicated, but to the end user, it will appear very simple: he clicks a prim, the object sends him a request to open a web page, he opens the page and sees a form. He fills out the form, presses submit, and voila, you have the data you needed. The back-end scripting is a little more complicated than basic LSL, but .php is pretty easy to work with, and mySQL too, if you have at least some experience.

Alternately, I would be happy to set this up for you some time. Send me a notecard in-world with more details and I'll return a price quote and time estimate.

Best of luck!
Lily
Amelia Marikh
Registered User
Join date: 27 May 2008
Posts: 4
04-07-2009 08:51
if you contact me inworld i can better help you. i have access to several ways that could help in what you are looking for