The Artima Developer Community
Sponsored Link

Agile Buzz Forum
More Facebook Work

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
More Facebook Work Posted: May 4, 2009 9:32 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: More Facebook Work
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

As it happens, the Facebook API is pretty easy to work with. I've made a lot of progress since the earlier post; I can now execute simple queries against the API and get useful data back. I also abstracted things out to a Connection class and a Session class, so the raw API isn't front and center anymore. Here's the usage model (bearing in mind that I'm building a desktop interface here):


holder := FacebookSecretHolder new
		apiKey: apiKey;
		secretKey: secret.


FacebookAPI new
	executeMethod:  method 
	withKey: holder apiKey
	withSecret: holder secretKey.

That sets up the necessary key information; here's the way you interact:


connection := Connection withSecretHolder: holder.
connection clearSession.
connection login.

At that point you have to deal with a web page; that's Facebook's API. If you're not logged in, you do that on the page. Then it's back to the app:


connection getSession.
ids := connection friendsGet.
connection getFriendsNamesFor: ids.
connection statusGet.
connection clearSession.

The friend query returns first and last names (it's getting minimal info back at the moment; the #getStatus returns the last 100 updates. Finally, #clearSession logs out. That's it - I'll do more tomorrow.

Technorati Tags: ,

Read: More Facebook Work

Topic: Twit-Squatting? Previous Topic   Next Topic Topic: Secure Environments Wander Away from the Mainstream

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use