Facebook Java 开发资料 收集

Categories: Java; Tagged with: ; @ December 4th, 2010 13:41

1. IBM DW 中文:  用 Eclipse Galileo 开发一个 Facebook 应用程序 – Helloworld 必备

2. IMB DW中文:  掌握 Facebook 应用程序开发,使用 PHP、Rational Application Developer、WebSphere Application Server 和 DB2 进行实现,第 1 部分: 安装设置组件

3. TheUnical Technologies: Facebook Java api example to publish on Wall

4. Facebook Doc: http://developers.facebook.com/docs/

5. Facebook-java-api example: http://code.google.com/p/facebook-java-api/wiki/Examples

6. IBM DW: Develop a Facebook application using both PHP and Java programming languages

Facebook: App安装/授权页面 PHP代码示例

Categories: Java; Tagged with: ; @ December 4th, 2010 13:26

App安装界面:

image

(more…)

Facebook: 使用Java API发布内容

Categories: Java; Tagged with: ; @ December 4th, 2010 12:39

需求: 通过Java端直接发布内容到Facebook Wall.

使用的API:
http://code.google.com/p/facebook-java-api/ 该API需要依附于HttpClient3, Json.  源自官方Java api.

Java端发布代码:

	/**
	 * update Facebook wall.
	 * @param infiniteSessionKey
	 * @param mesg
	 * @return
	 */
	public boolean publishMesg(String infiniteSessionKey, String mesg) {
		try {
			FacebookJsonRestClient facebook = new FacebookJsonRestClient(API_KEY, SECRET_KEY, infiniteSessionKey);
			FacebookJsonRestClient facebookClient = (FacebookJsonRestClient)facebook;
			facebookClient.stream_publish(mesg, null, null, null, null);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

对于普通用户:

1.  安装并授权程序

2. 获得infiniteSessionKey, Java端将使用infiniteSessionKey随时访问更新Facebook.

主要参考: http://blog.theunical.com/facebook-integration/facebook-java-api-example-to-publish-on-wall/



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.