Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK votes: 4
Posted: Sat May 06, 2006 9:05 pm Post subject: User Display Picture
First off, I wan't too sure where to post this, so I just stuck it here. Would an admin be kind enough to move it to the right section if it's not in the right place
Right, I've already made a status indicator (soon to go online, just on my computer at the moment) and it does most things, including personal messages, playing music, current status, but I don't have any idea on how to get a display picture updated (both logic and code).
I'm running the status bot on a modified MSN.PM+MSNP11&P2P module (everything is still intact that was before, but I sorted out all the contacts, pending lists and command handling errors), and I would be grateful for anyone elses help
The image itself is made by a PHP script, and I would prefer to upload the display picture from the perl bot to a directory.
To upload the picture using Perl, you should use Net::FTP to directly upload the file, or simply send the information required to your already-working PHP script, which will then generate it. An example of the PHP version (which I recommend, seeing as you've already got it working is this:
Code:
# The perl section - in your bot, possibly on a timer every 5 minutes or whatever
use LWP::Simple;
my $get = get('http://site.com/upload.php?psm='.$psm.'&email='.$email.'&status=busy');
warn $email.'\'s image failed to generate.' if (!$get);
Then in the PHP, use the code as before, echoing "1" if it was successful, or "0" if it wasn't.
Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK votes: 4
Posted: Sat May 06, 2006 10:18 pm Post subject:
I'm not sure you understood (no offense intended), I want to upload the users display picture to a folder, so it can be included by the PHP script (in the position of the WLM default display picture shown in the status image).
The problem I'm having is actually receiving the display picture from the user in the perl bot
What you're looking for is quite advanced, and requires direct reference to the protocol.
Look at the P2P modules with Custom Emoticon recieving and see how it works..do some packet sniffing for display pictures, and convert the code over from CE to DP. This hasn't been done before in Perl as far as I know, so any progress you make (and share :>) will be very welcome.