PHP Classes
elePHPant
Icontem

File: yahoo_group_invite.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manuel Lemos  >  PHP HTTP protocol client  >  yahoo_group_invite.php  >  Download  
File: yahoo_group_invite.php
Role: Example script
Content type: text/plain
Description: Script to login in Yahoo and invite users to a Yahoo!Groups mailing list
Class: PHP HTTP protocol client
HTTP client to access Web site pages
Author: By
Last change: Synchronized with CVS version
Date: 3 years ago
Size: 1,498 bytes
 

Contents

Class file image Download
<?php
/*
 * yahoo_group_invite.php
 *
 * @(#) $Header: /opt2/ena/metal/http/yahoo_group_invite.php,v 1.1 2006/04/07 21:44:23 mlemos Exp $
 *
 */

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

   
$yahoo = new yahoo_user_class;
   
$yahoo->user = 'yahoouser';
   
$yahoo->password = 'yahoopassword';
   
$group='groupname';
   
$users=array(
       
"peter@gabriel.org",
       
"paul@simon.net",
       
"mary@chain.com"
 
);
   
$message = "Hello,\n\n".
       
"This is an invitation to join our group at Yahoo!\n\n".
       
"Please follow the instructions to accept the invitation and start participating.\n\n".
       
"Regards,\n\n".
       
"the moderator\n";
   
$parameters = array();
   
$success = $yahoo->InviteToGroup($group, $users, $message, $parameters);
?>
<html>
<head>
<title>Invite users to a Yahoo group</TITLE>
</head>
<body>
<h1 style="text-align: center">Invite users to a Yahoo group</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['Invited']))
            {
?>
<h2 style="text-align: center"><?php echo $parameters['Invited']; ?> users were successfully invited to Yahoo group <?php echo $group; ?> .</h2>
<?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>