當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LinkedIn::suggestedGroups方法代碼示例

本文整理匯總了PHP中LinkedIn::suggestedGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP LinkedIn::suggestedGroups方法的具體用法?PHP LinkedIn::suggestedGroups怎麽用?PHP LinkedIn::suggestedGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在LinkedIn的用法示例。


在下文中一共展示了LinkedIn::suggestedGroups方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SimpleXMLElement

                    }
                } else {
                    // request failed
                    echo "Error retrieving groups memberships: <br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre>";
                }
                ?>
      			
      			<hr />
      			
      			<h3 id="groupsSuggested">Suggested Groups:</h3>
            
            <p>Groups that LinkedIn thinks you might be interested in:</p>
            
            <?php 
                $OBJ_linkedin->setResponseFormat(LINKEDIN::_RESPONSE_XML);
                $response = $OBJ_linkedin->suggestedGroups();
                if ($response['success'] === TRUE) {
                    $suggested = new SimpleXMLElement($response['linkedin']);
                    $count = 1;
                    foreach ($suggested as $group) {
                        $gid = (string) $group->id;
                        $group_name = $group->name;
                        $group_open = $group->{'is-open-to-non-members'} == 'true' ? TRUE : FALSE;
                        ?>
              	<div><span style="font-weight: bold;"><?php 
                        echo $group_name . ' (' . ($group_open ? '' : 'not') . ' open to non-members)';
                        ?>
</span></div>
              	<?php 
                        if ($count == 1) {
                            $response = $OBJ_linkedin->group($gid, ':(id,name,short-description,relation-to-viewer:(membership-state,available-actions),is-open-to-non-members,category,contact-email)');
開發者ID:VarunTalik,項目名稱:simple-linkedinphp,代碼行數:31,代碼來源:groups.php


注:本文中的LinkedIn::suggestedGroups方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。