Skip to content

arpitgautam/AsyncFBClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsyncFBClient

An Asynchronous light wrapper around uniRest for accessing facebook graph API. Currently provides only access to user details.

Supply access token in \properties\app.properties and run the main method.

Usage

	String ACCESS_TOKEN = "";//Supply access token here

	AsyncFBClient fbClient = new OAuth2AsyncFBClient(ACCESS_TOKEN,
			new UniRestWrapper());
	CompletionNotifier notifier = new CompletionNotifier();
	fbClient.getFriendList(notifier);
	while (true) {
		if (!notifier.isDone()) {
			Thread.sleep(100);
			// or do processing here in the meanwhile
		} else {
			Friends friends = notifier.deserialize(Friends.class);
			if (fbClient.hasNext()) {
				fbClient.getNext(notifier);

			} else {
				break;
			}
			//process result from last req here
			for (Datum data : friends.getData()) {
				System.out.println(data.getName());
			}
		}
	}
}

About

Facebook Java client with both sync and async mode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published