PHP Classes

File: yahoo_export_address_book.php

Recommend this page to a friend!
  Classes of Manuel Lemos   PHP HTTP protocol client   yahoo_export_address_book.php   Download  
File: yahoo_export_address_book.php
Role: Example script
Content type: text/plain
Description: Script to login in Yahoo and export the user address book
Class: PHP HTTP protocol client
HTTP client to access Web site pages
Author: By
Last change: Synchronized with CVS version
Date: 13 years ago
Size: 1,242 bytes
 

Contents

Class file image Download
<?php
/*
 * yahoo_export_address_book.php
 *
 * @(#) $Header: /opt2/ena/metal/http/yahoo_export_address_book.php,v 1.4 2006/04/10 06:51:43 mlemos Exp $
 *
 */

   
require('http.php');
    require(
'yahoo_user.php');

   
$yahoo = new yahoo_user_class;
   
$yahoo->user = 'yahoouser';
   
$yahoo->password = 'yahoopassword';
   
$parameters = array();
   
$success = $yahoo->ExportAddressBook($parameters);
?>
<html>
<head>
<title>Export Yahoo user address book</TITLE>
</head>
<body>
<h1 style="text-align: center">Export Yahoo user address book</h1>
<hr />
<?php
   
if($success)
    {
        if(
strlen($yahoo->logged_user))
        {
?>
<h2 style="text-align: center">The user '<?php echo $yahoo->logged_user; ?>' has logged in Yahoo successfully.</h2>
<?php
           
if(IsSet($parameters['Data']))
            {
?>
<h2 style="text-align: center">The address book was exported to CSV format.</h2>
<center><table>
<tr>
<td><pre><?php echo HtmlSpecialChars(WordWrap($parameters['Data'], 75, "\n", 1)); ?></pre>
</td>
</tr>
</table>
<?php
           
}
        }
        else
        {
?>
<h2 style="text-align: center">The Yahoo user '<?php echo $yahoo->user; ?>' login attempt failed.</h2>
<?php
       
}
    }
    else
    {
?>
<h2 style="text-align: center">Error: <?php echo $yahoo->error ?></h2>
<?php
   
}
?>
<hr />
</body>
</html>