OpenSocialTutorial-7

IDtail.com API

Jump to: navigation, 찾기

목차

[편집] opensocial 환경 알기

idtail.com에서 제공하는 opensocial의 domain과 environment supported fields 는 아래와 같습니다.

[편집] 도메인

"idtail.com"

[편집] 지원되는 오픈소셜 객체

   'person' : {
     'id' : true,
     'name' : true,
     'thumbnailUrl' : true,
     'profileUrl' : true,
     'gender' : true,
     'schools' : true,
     'jobs' : true,
     'addresses' : true,
     'urls' : true,
     'interests' : true,
     'dateOfBirth' : true
   },
   'address' : {
     'locality' : true
   },
   'organization' : {
     'name':true,
     'startDate':true,
     'endDate':true,
     'webpage':true	
   },
   'url' : {
     'type':true,
     'linkText':true,
     'address':true
   },
   'activity' : {
     'id' : true,
     'externalId' : true,
     'userId' : true,
     'appId' : true,
     'streamTitle' : true,
     'streamUrl' : true,
     'streamSourceUrl' : true,
     'streamFaviconUrl' : true,
     'title' : true,
     'body' : true,
     'url' : true,
     'mediaItems' : true,
     'postedTime' : true,
     'customValues' : false
   },
   'activityMediaItem' : {
     'type' : true,
     'mimeType' : true,
     'url' : true
   }
 };

[편집] 예제

  • 밑에 예제는 opensocial 0.7버전 기준으로 작성되었습니다.
<Module>
 <ModulePrefs title="environment">
   <Require feature="opensocial-0.7"/>
 </ModulePrefs>
 <Content type="html">
   <![CDATA[
   <div id="content"></div>
   <script type="text/javascript" >

	gadgets.util.registerOnLoadHandler( init );

	function init() {
	        var c = '';
                var environment = opensocial.getEnvironment();
                c+= "도메인은 " +  environment.getDomain() + "입니다.<br />" ;
                if(environment.supportsField('person', 'gender')){
                    c+=  'person의 gender 정보는 지원됩니다.' + '<br />';
                }
                
                if(!environment.supportsField('person', 'emails')){
                    c+=  'person의 emails 정보는 지원되지 않습니다.' + '<br />';
                }
                
                if(!environment.supportsField('address', 'latitude')){
                     c+=  'address의 latitude\(경위도\) 정보는 곧 지원될 수 있도록 하겠습니다.' + '<br />'; 
                }
  	        
                document.getElementById('content').innerHTML = c;
        }

	</script>
	]]>
</Content>
</Module>

이전 페이지 | 다음 페이지