当前位置: 首页>>代码示例>>Java>>正文


Java FacebookType.getId方法代码示例

本文整理汇总了Java中com.restfb.types.FacebookType.getId方法的典型用法代码示例。如果您正苦于以下问题:Java FacebookType.getId方法的具体用法?Java FacebookType.getId怎么用?Java FacebookType.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.restfb.types.FacebookType的用法示例。


在下文中一共展示了FacebookType.getId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: post

import com.restfb.types.FacebookType; //导入方法依赖的package包/类
@Override
public String post(FacebookPosting posting) {
	try {
		FacebookClient facebookClient = new DefaultFacebookClient(ACCESS_TOKEN);
		FacebookType publishMessageResponse = facebookClient.publish(FACEBOOK_PAGE + "/links", FacebookType.class, 
			Parameter.with("message", posting.getMessage()),
			Parameter.with("link", posting.getLink()),
			Parameter.with("og:name", posting.getName()),
			Parameter.with("description", posting.getDescription()),
			Parameter.with("icon", posting.getPicture()),
			Parameter.with("picture", posting.getPicture())
		);
		String facebookUrl = "http://www.facebook.com/permalink.php?story_fbid=" + publishMessageResponse.getId() + "&id=" + FACEBOOK_PAGE;
		log.info("Successfully posted [" + posting.getMessage() + "] to Facebook at [" + facebookUrl + "].");
		return facebookUrl;
	} catch (RuntimeException e) {
	    log.warning("Failed to post [" + posting.getMessage()  + "] to Facebook.");
		log.throwing(getClass().getName(), "post", e);
		throw e;
	}
}
 
开发者ID:plexiti,项目名称:the-job-announcement,代码行数:22,代码来源:FacebookPostingServiceImpl.java

示例2: publishMessage

import com.restfb.types.FacebookType; //导入方法依赖的package包/类
String publishMessage() {
  out.println("* Feed publishing *");

  FacebookType publishMessageResponse =
      facebookClient.publish("me/feed", FacebookType.class, Parameter.with("message", "RestFB test"));

  out.println("Published message ID: " + publishMessageResponse.getId());
  return publishMessageResponse.getId();
}
 
开发者ID:restfb,项目名称:restfb-examples,代码行数:10,代码来源:GraphPublisherExample.java

示例3: publishEvent

import com.restfb.types.FacebookType; //导入方法依赖的package包/类
String publishEvent() {
  out.println("* Event publishing *");

  Date tomorrow = new Date(currentTimeMillis() + 1000L * 60L * 60L * 24L);
  Date twoDaysFromNow = new Date(currentTimeMillis() + 1000L * 60L * 60L * 48L);

  FacebookType publishEventResponse =
      facebookClient.publish("me/events", FacebookType.class, Parameter.with("name", "Party"),
        Parameter.with("start_time", tomorrow), Parameter.with("end_time", twoDaysFromNow));

  out.println("Published event ID: " + publishEventResponse.getId());
  return publishEventResponse.getId();
}
 
开发者ID:restfb,项目名称:restfb-examples,代码行数:14,代码来源:GraphPublisherExample.java

示例4: publishPhoto

import com.restfb.types.FacebookType; //导入方法依赖的package包/类
String publishPhoto() {
  out.println("* Binary file publishing *");

  FacebookType publishPhotoResponse = facebookClient.publish("me/photos", FacebookType.class,
    BinaryAttachment.with("cat.png", getClass().getResourceAsStream("/cat.png")),
    Parameter.with("message", "Test cat"));

  out.println("Published photo ID: " + publishPhotoResponse.getId());
  return publishPhotoResponse.getId();
}
 
开发者ID:restfb,项目名称:restfb-examples,代码行数:11,代码来源:GraphPublisherExample.java

示例5: publishPhoto

import com.restfb.types.FacebookType; //导入方法依赖的package包/类
String publishPhoto() {
  out.println("* Binary file publishing *");

  FacebookType publishPhotoResponse =
      facebookClient.publish("me/photos", FacebookType.class,
        BinaryAttachment.with("cat.png", getClass().getResourceAsStream("/cat.png")),
        Parameter.with("message", "Test cat"));

  out.println("Published photo ID: " + publishPhotoResponse.getId());
  return publishPhotoResponse.getId();
}
 
开发者ID:oleke,项目名称:Gender-Mining,代码行数:12,代码来源:GraphPublisherExample.java

示例6: mapToTopicMap

import com.restfb.types.FacebookType; //导入方法依赖的package包/类
@Override
Topic mapToTopicMap(TopicMap tm) throws TopicMapException {
    FacebookType entity = getEnclosedEntity();

    if(entity == null) return null;
    
    String id = entity.getId();
    String name;
    if(entity instanceof NamedFacebookType){
        name = ((NamedFacebookType)entity).getName();
    } else {
        name = id;
    }
    
    logger.log("Processing graph object: " + name);
    
    Topic entityTopic = getOrCreateTopic(tm, getSIBase() + id, name + " (" + id + ")");
    
    Topic entityType = getOrCreateType(tm, getType());
    Topic facebookTopic = getFacebookTopic(tm);
    makeSubclassOf(tm, entityType, facebookTopic);
    
    entityTopic.addType(entityType);
    
    Topic idType = getOrCreateType(tm, "id");
    
    entityTopic.setData(idType, getLangTopic(tm), id);
    
    return entityTopic;
    
}
 
开发者ID:wandora-team,项目名称:wandora,代码行数:32,代码来源:AbstractFBTypeWrapper.java


注:本文中的com.restfb.types.FacebookType.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。