PHP Classes

File: example_simplechat.php

Recommend this page to a friend!
  Classes of Protung Dragos   PHP Yahoo Messenger Archive Decoder   example_simplechat.php   Download  
File: example_simplechat.php
Role: Example script
Content type: text/plain
Description: Example for normal chat
Class: PHP Yahoo Messenger Archive Decoder
Parse Yahoo messenger chat history files
Author: By
Last change:
Date: 14 years ago
Size: 1,488 bytes


Class file image Download

// Include the class

// Instantiate the object
$ymad = new YahooMessengerArchiveDecoder();

// Load the archive
// It can have any name, does not need to have the original name
// As does not allow to upload binary data you must test it with your own archive
// Do not forget to change the name and the rest of the parameters

// Set the yahoo messenger ID of the owner of the archive (to what ID does the archive belong to ?)
$ymad->setUserId("dragos_protung"); // yeah, this is my messenger ID :)

// Set a name or alias of the owner of the archive
// This will be used as the name to be displayed instead of the ID when fetching the messages
// The Yahoo Messenger ID is still mandatory

// Set the name of the chat buddy
// The archive does not store this so you have to put a name
// If no name is entered "buddy" will be used

// Decode the archive
// This method also returns the messages
// If the parameter is set to "false", then the format (font size, color, etc) will NOT be stripped

// Just print out the messages, or do anything you want with them :)
foreach ($ymad->getMessages() as $message) {
$message["sentBy"]." (".$message["timestamp"]."): ".$message["message"]."\n";