Even More Work on the Facebook interface
I had a fairly unpleasant day, so it was relaxing to sit down this evening and get back to work on my interface to the Facebook API. I've cleaned up the way the API functions respond; whenever you invoke a method like friends.get, you'll either get the result documented on the API pages, or an error object (as documented there as well). If there's an error at the network level, you'll still get an error object, but it'll be generated by the Smalltalk interface itself.
That gives me a lot more predictability in the code - it's much clearer what will come back when APIs are called. So here's an example call:
connection := Connection withSecretHolder: holder. connection login. connection authGetSession. groups := connection groupsGetByGroups: #() andUID: nil.
That responds with something like this:

That's a collection of Group objects, each of which has a bunch of data stuffed into it. It's getting to the point where I can do real things with this :)
Technorati Tags: social media, facebook


Comments
Still ...
[Claus] May 10, 2009 15:47:15.083
'Detected unrecognized cookie attribute: httponly'
in:
Facebook.Connection login,
Facebook.FacebookInterface >> doPost: shouldUseHttps
Bundle loaded in plain VW 7.6 image.
Something might be amiss still?
Re: Even More Work on the Facebook interface
[ anonymous] May 10, 2009 18:13:13.654
Comment by anonymous
I've loaded it clean into a VW 7.6 and VW 7.7 image, and it all works fine. If you don't have a Facebook application defined, it's not going to work at all though
[Claus] May 11, 2009 4:56:08.064
Facebook Application is defined, of course.
Do you need to do anything with secretKey, apiKey, appId?
Re: Even More Work on the Facebook interface
[ anonymous] May 11, 2009 6:26:35.995
Comment by anonymous
If you don't have those defined in the FacebookSecretHolder object, then nothing is going to work. You need to have your own Facebook application defined (i.e., at the Facebook site), and have those pieces of data.
...
[Claus] May 11, 2009 7:51:52.436
Yes, of course. I was aiming at encryption or something like that. But it appears not to be a data issue.
It appears that facebook responds with a cookie with the httponly parameter and Net.Client fails to understand this parameter when parsing the cookie response.
I do not get an error from Facebook, i get a cookie parsing error from VW.