by Andrei Hetel
12. December 2009 16:17
Better think twice before starting a Facebook application using AP.NET - it's PHP world there. That could change in the future because I could see some C# example in Facebook wiki, which is a big step forward I suppose. More than this, in the glorious day when I finally manage to integrate some Facebook functionality into Ysabel, Facebook Developer Toolkit released version 3.0 (all my code is based on 2.0 - and people are complaining about backward compatibility) - that really made my day!
According with the pages that I read about ASP.NET and Facebook it's best to choose an IFRAME application type and use master pages. Not 100% if it's the best strategy, but this is what I've done.
Anyway, it took me a couple of hours to figure out how to run a FQL query, and after that to do something with the result, but it's finally working. I was surprised that only couple of lines of code are needed.
A working piece of code looks like this:
Dim fbAPI As new facebook.API
Dim query As String
Dim xmlDR As String
Dim ds As DataSet
fbAPI.ApplicationKey = "your application key"
fbAPI.Secret = "your secret key"
query = "select uid, name from user where uid in (select uid2 from friend where uid1=" & your_Facebook ID & ")"
xmlDR = fbAPI.fql.query(query)
ds = New DataSet()
ds.ReadXml(New StringReader(xmlDR), XmlReadMode.InferSchema)
Dataset returned contains 2 datatables, in the second datatable is the data you have requested (complete list of your friends according to the above query).
Simple isn't it? Happy coding.
by Andrei Hetel
25. November 2009 17:23
It's been a long time since I didn't write a single word here - lack of time unfortunately.
If you are an ASP.NET programmer and want to write a
Facebook application, you can start by taking a look at
Facebook Developer Toolkit. I'll tell you from start that it's not easy, I pull the hair out of my head trying to do some very simple things (at first sight).
Toolkit it's pretty useful, far from being perfect, but at least there is something. Long and short is that I finally find some time to finish the project of writing a version of
Ysabel for Facebook! You can
play it here.
Category: Facebook
Tags: Facebook