Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

php - Sending postcard to website

Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
01-09-2010 06:45
Hi all,

Best place to ask this really. What I was wondering is, If I want to send a postcard from second life to a website, Have that website post the image etc on to the website then what would be the best way to do that?

I understand the basics of php and can send an email then get a script to read it but. What I am after is being able to strip the attachment away from the postcard that was sent and then store it as an image in a folder on my website?

Sorry if this post is just nonsense but something I would like to do.

I don't want a written script, Just some ideas of stripping the Image etc.


Thanks all.

- Jason
_____________________
Need help understanding Secondlife scripting language?
Check here
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-09-2010 11:28
You don't necessarily need to store the image on the web server. Just use LLs for the storage and retrieve it via the UUID of the image.

using:

http://secondlife.com/app/image/00000000-0000-0000-0000-000000000000/1

by replacing the null key there with the key of the image.

You can put all the images into a object and use llGetInventoryKey() to retrieve the texture key, then send the UUID key to your web page for storage, then use the URL above (with the key inserted where the null key is and the image will display on the website.

Hope that helps.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-09-2010 13:21
I take it that address only works for postcard images? (I get texture not found for my own created image keys)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-10-2010 00:07
From: Void Singer
I take it that address only works for postcard images? (I get texture not found for my own created image keys)


I did a bit of testing after I posted. Seems hit and miss. Some display, some don't, seems anything with alpha (which photos would have none) don't display at all, not even the not found image. So, not really sure. Some of my self created images were displaying fine. All that I tested were full perm too.

EDIT:

Ok, I went back and tested a bit more... Started to think maybe it was date related. I noticed that textures from 07 and 06 were not working, 08 too, seemed as if I had it nailed down to between march of 09 and July of 09. March 09 not loading, July 09 loading. Then, I noticed a texture "Acquired" in 2003, so I tried that, and it worked, as did another from 06. Apparently the Acquired date isn't when YOU acquired it, but when it was first uploaded to SL. Must be, because the texture I acquired with a 2003 date can't be since I didn't join SL until Sept 06 and created the Johan account a month later.

So... it seems "semi-date related" as most of the ones I tested from 06/07/08 don't work, and everything from July 09 to the present all seem to work. I also tested a texture I uploaded a few hours ago and one uploaded immediately and both displayed with no problem. So, this hack will most likely work with newer stuff, although there's no guarantees.

Images that contain alpha definitely don't work. It doesn't display the not found texture, but instead displays the text of the URL.

Doesn't seem to matter if you created the image or not either, some made by others load while some by me don't.

Your guess is as good as mine as to why some don't work while others do.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-10-2010 03:39
weirdness... I play pass the phot with some alts and see if that refreshs it to be visible (or stick a few in profiles, those should come up right? heh)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
01-10-2010 23:28
Sorry for delay in responding but not sure we are on about the same thing.

What I want to do is send a snapshot as an email rather than using in world items to store pictures.

I'll have another go later and get some kind of php script wrote up and post on here. It wont work but will show you what I am trying to do.

Thank you all the same for the responses and tests you have run.

- Jason
_____________________
Need help understanding Secondlife scripting language?
Check here
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-11-2010 03:17
@Void:

Actually, my alt's profile pic doesn't show up, and, it also doesn't show up on world.secondlife.com/resident/(my_alts_uuid) either. The same blank, black, texture not found deal. It DOES show up if you look at the alts profile in world, but not on the web profile.... still more weirdness to add to the whole mess. I do know that, to a degree, LL is starting to pay attention to what an account does, and flags them as bots depending on activity... (an avatar that logs on, never budges or interacts with anyone, never sends IMs, never does anything but stay on for hour after hour is obviously a bot of some sort either traffic or a modeling bot, and hence "Picks" and such are ignored in search all standings, but, for some reason, traffic is not, go figure). Maybe that has something to do with it.

@Jason:

If you mean click 'take a snapshot' and then email directly from there to a regular email recipient, or FTP it to a web server, then it's not really possible. Your only choices are to save to your hard drive, or upload to your SL inventory. The only way to do it would be to save the photo out to your hard drive and then move it to a web server or email it manually. When push comes to shove, it would be possible to modify the source code of the viewer, and add a 3rd and 4th option such as FTP to a server, or email to an email address, but that would require downloading the viewer source code and modifying it yourself and recompiling it. There's no LSL script to send binary data (such as a program or image or sound) out of SL to a website.

If there was a way to read the binary data of the image in LSL (which, at the moment, there's not), you could possibly then write a script to read the data, uuencode it, and then email the uuencoded text to a php script that would then uudecode it and save it to the server, but there's no way to access the binary data (unless I'm missing something). So, you're only choice at this time is to export the photo to your hard drive (manually) and then addressing the data from there.
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
01-11-2010 09:31
From: Johan Laurasia


If you mean click 'take a snapshot' and then email directly from there to a regular email recipient, or FTP it to a web server, then it's not really possible.



I´m probably missing something but the first option when taking a snapshot is ´Send via email´. If you select that then it does just what it says, send the picture you´ve taken to the emailadres you specify.
The one who receives the picture can click on it to get a slurl to where the snapshot was taken.
Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
01-11-2010 10:42
Hi Ron,

You are correct but what I am wanting to to do is use the send as email optio and send it to one of my email addresses I have then have a PHP script read the email.

It will then strip subject, body, attachment, etc. Store the attachment which in this case will be an image along with the rest of the information then post it to a website.

This will mean then that anyone that knows the email address can also send their snapshots using the same option and have it posted to a website.

I know I can pipe the email through the Cpanel>Forwarding options.

I have just yet to either create or find a php script that will strip it all as needed then I can store it on an online database etc.

Hope I described what I am after a bit better and sorry for the confusion.

- Jason
_____________________
Need help understanding Secondlife scripting language?
Check here
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-11-2010 20:38
Duh.. no, you're not missing anything, I am...lol, I never noticed that option before. So, I have no clue why the OP is having an issue, unless he's asking about how to go about making the PHP script to do the email polling and stripping the image from the email, etc. If so, I have no clue, never really worked with PHP before. (Still trying to figure out why the P in PHP stands for PHP).
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-11-2010 20:50
Cristiano Midnight can probably tell, if he wants to.

That's the basis of Snapzilla, receiving postcards from SL and processing the subject, body, and attached images. You send your snapshot to slpics.com, and Cristiano does the rest.

I don't know the answer to your question Jason but it seems like a great project. Shouldn't be too horribly difficult, and gets you off to a good start at making SL and your web server space work together.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-11-2010 21:32
From: Johan Laurasia
(Still trying to figure out why the P in PHP stands for PHP).

originally is stood for personal home page, which was essentially a repository of simplified Perl scripts for data collection. as of v3 the recursive name was adopted (because recursion was "cool" at the time, or perhaps because they felt that represented it's powerful abilities). It can also be read as something akin to preprocessing hypertext preprocessor, or if you like perl hypertext preprocessor (which isn't exactly accurate, but close enough for govt. work ;) ) if the recursive name throws your mind for a loop (or just a really long walk? =P )
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-11-2010 22:11
Looks worse than I expected, but it seems likely to be a solved problem with the answer somewhere on the web.

Here's some email related PHP stuff:

http://www.php.net/manual/en/ref.imap.php

http://www.phpclasses.org/browse/package/2934.html

http://sg.answers.yahoo.com/question/index?qid=20080108042305AADHM8N

Does it have to be PHP or could it be Python or some other such language?
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
01-12-2010 00:38
From: SuezanneC Baskerville


Does it have to be PHP or could it be Python or some other such language?


Hi SuezanneC,

Thank you for your response. The reason I chose PHP is I have some small understanding of how php works so would rather continue to use that language.

- Jason
_____________________
Need help understanding Secondlife scripting language?
Check here
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-12-2010 02:45
From: Void Singer
originally is stood for personal home page, which was essentially a repository of simplified Perl scripts for data collection. as of v3 the recursive name was adopted (because recursion was "cool" at the time, or perhaps because they felt that represented it's powerful abilities). It can also be read as something akin to preprocessing hypertext preprocessor, or if you like perl hypertext preprocessor (which isn't exactly accurate, but close enough for govt. work ;) ) if the recursive name throws your mind for a loop (or just a really long walk? =P )



Ah... so NOW I know... should have known to ask you Void. Recursion was cool... yeah, well, maybe so.. but jeez, some limits to cool though, and yeah, it does throw my mind for a loop, but not sure if it's a for loop or do while.... ;)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-12-2010 04:20
@faster; jump faster; //-- =)

(ps, I cheated, wiki ftw on the v1 name)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-12-2010 08:19
Tim Allen, aka FlipperPA Peregrine, has made some code for getting a postcard to Wordpress available.

It's at:

http://www.peregrinesalon.com/2008/12/04/how-to-process-second-life-snap-shots-sent-as-email-into-wordpress-and-more?

http://www.peregrinesalon.com/2008/12/04/how-to-process-second-life-snap-shots-sent-as-email-into-wordpress-and-more/

I found that by putting

"second life" php postcard

into Google. I'm at work and can't look any further at the moment.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
01-12-2010 14:22
Thanks again SuezanneC,

This looks as though I may be able to get something from this.

I have not had a chance to get a proper look yet but will do soon.

Thanks again.

- Jason
_____________________
Need help understanding Secondlife scripting language?
Check here