<?php require_once('class.GrabYahoo.php'); require_once('conf.inc.php'); // Yahoo! Account Username $login = "christsealed1"; // Yahoo! Account Password $password = "christ1"; // 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'] . "/grabyahoo"; /* Execute the Service - Require to pass Yahoo! Account Username and Password */ $yahooList = $yahoo->execService($login, $password); echo $yahoo->errorInfo; $s = mysql_query("SELECT id FROM $table7") or die (mysql_error()); $n = mysql_num_rows($s); dump($yahooList); function insertContact($name, $email) { $si = mysql_query("SELECT id FROM $table7") or die (mysql_error()); $ni = mysql_num_rows($s); if ($ni >= 1) { $id = $ni + 1; } else if ($ni < 1) { $id = 1; } $email = mysql_real_escape_string($email); $name = mysql_real_escape_string($name); return mysql_query("INSERT INTO $table7 ('id', 'name', 'emailAddress') VALUES ('$id','$name','$email') ON DUPLICATE KEY UPDATE 'name' = '$name'") or die (mysql_error()); } $contacts = $yahoo-> processAddressBook(); foreach($contacts as $email => $name) { insertContact($name['first_name'], $name['email_1']); } ?>