PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Ehsanul Haque   Grab Yahoo   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: PHP Script to test the class
Class: Grab Yahoo
Grab the contact list, calendar of an Yahoo user
Author: By
Last change: Simple modification
Date: 16 years ago
Size: 1,522 bytes
 

Contents

Class file image Download
<?

require_once('class.GrabYahoo.php');

// Yahoo! Account Username
$login = "username";

// Yahoo! Account Password
$password = "password";

// Initializing Class
$yahoo = new GrabYahoo;

/*
Setting the desired Service
  1. addressbook => Used to grab Yahoo! Address Book
  2. messenger => Used to grab Yahoo! Messenger List
  3. newmail => Used to grab number of new Yahoo! mails
  4. calendar => Used to grab Yahoo! Calendar entries
*/
$yahoo->service = "addressbook";

/*
Set to true if HTTP proxy is required to browse net
  - Setting it to true will require to provide Proxy Host Name and Port number
*/
$yahoo->isUsingProxy = false;

// Set the Proxy Host Name, isUsingProxy is set to true
$yahoo->proxyHost = "";

// Set the Proxy Port Number
$yahoo->proxyPort = "";

// Set the location to save the Cookie Jar File
$yahoo->cookieJarPath = $_SERVER['DOCUMENT_ROOT'] . "/GrabYahoo1.3";

/*
Execute the Service
  - Require to pass Yahoo! Account Username and Password
*/
$yahooList = $yahoo->execService($login, $password);

// Printing the array generated by the Class
dump($yahooList);

/*
Printing new mail status
  - True (1) if there is new mail(s)
  - False (0) if there is no new mail
*/
//$newMailStatus = $yahoo->getNewMailStatus();
//echo $newMailStatus;

// Use this line to figure out any error generated during the process
echo $yahoo->errorInfo;

function
dump($var)
{
  echo
"<pre>";
   
print_r($var);
  echo
"</pre>";
}

?>