Web2Messenger Forum
September 08, 2010, 09:27:59 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Site Home   Forum Home   Help Search Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: PHP Class/API thingy for Image&Text integration  (Read 1059 times)
0 Members and 1 Guest are viewing this topic.
30021190
Newbie
*
Posts: 6


View Profile
« on: December 23, 2009, 09:15:34 AM »

Just a very basic php script with functions written in.

I dunno if its useful to other people but its useful to me.

There's no media type handling yet, and it doesnt check for any errors properly either but these might come if I feel the need to add them.

Any problems, just fix them yaself or post here. but please NO "How do I do PHP?" questions. Feel free to modify the script as long as you keep credit to me.

Download: http://data.aboutcher.co.uk/w2m%20API.zip
Demo: http://data.aboutcher.co.uk/w2m_demo/

to try it out with your own status, change the URL, change the u value to your username and change the i value to an image style to one of these "v7","v8","blue","black","solid","min" .

hope you guys n gals like it.
« Last Edit: December 23, 2009, 09:21:50 AM by 30021190 » Logged
30021190
Newbie
*
Posts: 6


View Profile
« Reply #1 on: December 23, 2009, 07:11:24 PM »

After spending most of today on my University project, I have acomplished what I need. I will release my code once it is more refind, the code will allow to send messages from the web via PHP.
Logged
30021190
Newbie
*
Posts: 6


View Profile
« Reply #2 on: December 24, 2009, 10:34:39 AM »

Added Smiley support including the *red+u etc.

Smiley support is optional, ya just run the text through a smiley function.

Still to do:
[em]Error Checking for sent messages (ie not sent, email wrong etc etc)[/em]
Logged
30021190
Newbie
*
Posts: 6


View Profile
« Reply #3 on: December 24, 2009, 01:32:34 PM »

Right, finally all should be done and sorted. (useful links below)
This works with PHP5.

Heres a quick run down, also this is the only documentation written.

1. Include the file 'w2m.inc.php'
with
Code:
include 'w2m.inc.php';
or
Code:
require 'w2m.inc.php';

2. Grabbing the Status of your MSN

Change YOUR_USERNAME_HERE with your W2M Username
Code:
$W2M_username = "YOUR_USERNAME_HERE";
$status = MSN_status($W2M_username);
echo $status;

3. Grabbing a Status Image of your MSN

Change YOUR_USERNAME_HERE with your W2M Username
Change IMAGE_SET with one of these ("v7","v8","blue","black","solid","min")
Code:
$W2M_username = "YOUR_USERNAME_HERE";
$type = "IMAGE_SET";
$img = MSN_status_img($W2M_username,$type);
echo $img;

4. Grabbing Your MSN display name

Change YOUR_USERNAME_HERE with your W2M Username
Code:
$W2M_username = "YOUR_USERNAME_HERE";
$name = MSN_dispname($W2M_username);
echo $name;

4. Grabbing Your MSN personal Message

Change YOUR_USERNAME_HERE with your W2M Username
If you include HTML in your PM, then you can choose to have it work as HTML, just cahnge $html to 1, but this will turn <a href="http://example.com">Example</a> into a link such as Example.
Code:
$W2M_username = "YOUR_USERNAME_HERE";
$html = "0";
$pm = MSN_personal($W2M_username,$html);
echo $pm;

5. Turning smilies on, in your PM or Name

Change TEXT with wither the output of your displayname OR PM
Code:
$msg = "TEXT";
$smiley = MSN_smiley($msg);
echo $smiley;

6. Send a Message to MSN via PHP

This one too me ages to write. So hope it all works fine.
Change YOUR_USERNAME_HERE with your W2M Username and
Change 0123456789abcdef0123456789abcdef01234567 with your W2M captchabypass code
Code:
$W2M_username = "YOUR_USERNAME_HERE";
$W2M_SenderName = "ABC-XYZ Wesite";
$W2M_SenderEmail = "WebAPI@ABC-XYZ.com";
$W2M_SenderMSG = "THIS IS YOUR MESSAGE"
$W2M_CaptchaBypass = "0123456789abcdef0123456789abcdef01234567";
$send = MSN_send($W2M_username,$W2M_SenderName,$W2M_SenderEmail,$W2M_SenderMSG,$W2M_CaptchaBypass);
echo $send;

include the msn_images folder in the same location as the page that is calling up the function.

Download: http://data.aboutcher.co.uk/w2m%20API.zip
Demo: http://data.aboutcher.co.uk/w2m_demo/

Blurb
This is in no way written with any gurantee, the API library is not designed to collect data or destroy any data but if there is an error or bug in the API library then I hold no responability to it. I may fix bugs or may not, the API library comes with no support and you use it at your own risk.

But don't let that put you off, it should work fine.

You, may modify the code as long as you keep the original creator as myself. There are no "Powered by W2M" or "created by me" in this API library as they are easilly bypassed and annoy people but W2M say they would like a link back and I myself would like a link back to http://www.aboutcher.co.uk.

and Fianlly, this API library is not affiliated with W2M in anyway, it just uses their very cool service.

cheers.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.062 seconds with 20 queries.