Created
January 29, 2014 17:30
-
-
Save jgilmour/8692843 to your computer and use it in GitHub Desktop.
retrieve list of users in google group and format output into html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// | |
// pass url as http://site/user.php?id=googlegroup@domain.com | |
// | |
// | |
$clientLibraryPath = '/usr/local/lib/ZendGdata-1.11.11/library'; | |
$oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath); | |
require_once 'Zend/Loader.php'; | |
Zend_Loader::loadClass('Zend_Gdata'); | |
Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); | |
Zend_Loader::loadClass('Zend_Gdata_Gapps'); | |
$domain = "xxx.com"; | |
$emailaddr = "xxx@xxx.com"; | |
$emailpw = "xxx"; | |
$service = Zend_Gdata_Gapps::AUTH_SERVICE_NAME; | |
$client = Zend_Gdata_ClientLogin::getHttpClient($emailaddr, $emailpw, $service); | |
$gdata = new Zend_Gdata_Gapps($client, $domain); | |
$list = $_GET['id']; | |
$feed = $gdata->retrieveAllMembers($list); | |
?> | |
<!-- Display everything into Window. --> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<link href="style.css" type="text/css" rel="stylesheet"/> | |
</head> | |
<h2>Email List Information</h2> | |
<table> | |
<tr> | |
<td> </td> | |
<td>Email List:</td> | |
<td rowspan="100"> </td> | |
<td><?php echo $list ?></td> | |
</tr> | |
<tr><td colspan="4"><hr></td></tr> | |
<tr> | |
<td></td> | |
<td colspan="2" valign="top">Recipients:</td> | |
<td> | |
<?php | |
foreach ($feed as $member) { | |
foreach ($member->property as $p) { | |
if ($p->name == "memberId") { | |
echo $p->value . "<br>"; | |
} | |
} | |
} | |
?> | |
</td> | |
</tr> | |
<tr> | |
<td colspan="4"><hr></td> | |
</tr> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment