[Lift] Re: FacebookRestApi examples?
FYI -- I switched over to the java-based API and things seem smoother. (com.google.code.facebookapi). It sure is nice to have the ability to use java jars in scala... -Keith On Sep 18, 1:49 pm, Keith K quasike...@gmail.com wrote: Hi, Jon, Good to hear you're making progress. I'm now able to get a session established, as well as a FacebookClient. However, when I try to use it as follows, I get NullPointerExceptions no matter which of teh following method calls I use. val fbClient: FacebookClient = new FacebookClient (FacebookSession(fbSessionKey, 0L, fbUid)) fbClient !? GetInfo(List(123, 456, 789), Name, Hometown) fbClient.getInfo(List(fbUid.toLong, 3534L), AboutMe, FirstName, LastName) fbClient !? SendNotifications(brhello/br, fbUid.toLong) They all result in : Message: java.lang.NullPointerException net.liftweb.ext_api.facebook.FacebookClient$$anonfun$2.apply (FacebookRestApi.scala:46) net.liftweb.ext_api.facebook.FacebookClient$$anonfun$2.apply (FacebookRestApi.scala:46) scala.List.map(List.scala:812) net.liftweb.ext_api.facebook.FacebookClient$.call (FacebookRestApi.scala:46) net.liftweb.ext_api.facebook.FacebookClient.callMethod (FacebookRestApi.scala:148) com.liftworkshop.snippet.GameUtil.fbTest(GameUtil.scala:110) Maybe this is because I am using an infinite session key, but I doubt it since the call is not even making it out to FB. If you happen to have some code you'd be willing to share (JSON or not) I'd love to take a look. Thanks, -Keith On Sep 17, 1:43 pm, jon jonhoff...@gmail.com wrote: Hi Keith, You're missing a step in the process. The auth_token needs to be authenticated withfacebookbefore you request a session. You would do this by visiting a url like http://www.facebook.com/login.php?api_key=KEYauth_token=TOKENina web browser. I am using the FB API in a connect application, but have forked to speak json and added a few extra calls. - Jon On Sep 15, 8:02 pm, Keith K quasike...@gmail.com wrote: I don't see any thing obviously wrong in thefacebookpackage's method def genSignature(allParams: List[(String, Any)], secret: String). Wish I did! -Keith On Sep 15, 3:34 pm, Keith K quasike...@gmail.com wrote: Hello, I am able to get a certain distance, to the point where FB gives me back an authToken. Here is my code. println(FacebookRestApi.apiKey = + FacebookRestApi.apiKey); val respNode: Node = FacebookClient !? (AuthCreateToken); val authToken = respNode.text; println(authToken = + authToken); val fbSession: Option[FacebookSession] = FacebookSession.fromAuthToken(authToken) println(fbSession = + fbSession.toString); This doesn't include the code for the apiKey and secret. I see the following output: FacebookRestApi.apiKey = 25548077c8db93252a947a525d93be02 authToken = cd86be265bfcacf96a2dc392ffed874c fbSession = None Maybe as a scala newbie, I'm not handling the fbSession code properly, but it's coming back with None, which seems weird to me. On Sep 15, 2:02 pm, TylerWeir tyler.w...@gmail.com wrote: I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the LiftFacebookpackage? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebookclient, etc. Thanks, -Keith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: FacebookRestApi examples?
Hi, Jon, Good to hear you're making progress. I'm now able to get a session established, as well as a FacebookClient. However, when I try to use it as follows, I get NullPointerExceptions no matter which of teh following method calls I use. val fbClient: FacebookClient = new FacebookClient (FacebookSession(fbSessionKey, 0L, fbUid)) fbClient !? GetInfo(List(123, 456, 789), Name, Hometown) fbClient.getInfo(List(fbUid.toLong, 3534L), AboutMe, FirstName, LastName) fbClient !? SendNotifications(brhello/br, fbUid.toLong) They all result in : Message: java.lang.NullPointerException net.liftweb.ext_api.facebook.FacebookClient$$anonfun$2.apply (FacebookRestApi.scala:46) net.liftweb.ext_api.facebook.FacebookClient$$anonfun$2.apply (FacebookRestApi.scala:46) scala.List.map(List.scala:812) net.liftweb.ext_api.facebook.FacebookClient$.call (FacebookRestApi.scala:46) net.liftweb.ext_api.facebook.FacebookClient.callMethod (FacebookRestApi.scala:148) com.liftworkshop.snippet.GameUtil.fbTest(GameUtil.scala:110) Maybe this is because I am using an infinite session key, but I doubt it since the call is not even making it out to FB. If you happen to have some code you'd be willing to share (JSON or not) I'd love to take a look. Thanks, -Keith On Sep 17, 1:43 pm, jon jonhoff...@gmail.com wrote: Hi Keith, You're missing a step in the process. The auth_token needs to be authenticated withfacebookbefore you request a session. You would do this by visiting a url like http://www.facebook.com/login.php?api_key=KEYauth_token=TOKENin a web browser. I am using the FB API in a connect application, but have forked to speak json and added a few extra calls. - Jon On Sep 15, 8:02 pm, Keith K quasike...@gmail.com wrote: I don't see any thing obviously wrong in thefacebookpackage's method def genSignature(allParams: List[(String, Any)], secret: String). Wish I did! -Keith On Sep 15, 3:34 pm, Keith K quasike...@gmail.com wrote: Hello, I am able to get a certain distance, to the point where FB gives me back an authToken. Here is my code. println(FacebookRestApi.apiKey = + FacebookRestApi.apiKey); val respNode: Node = FacebookClient !? (AuthCreateToken); val authToken = respNode.text; println(authToken = + authToken); val fbSession: Option[FacebookSession] = FacebookSession.fromAuthToken(authToken) println(fbSession = + fbSession.toString); This doesn't include the code for the apiKey and secret. I see the following output: FacebookRestApi.apiKey = 25548077c8db93252a947a525d93be02 authToken = cd86be265bfcacf96a2dc392ffed874c fbSession = None Maybe as a scala newbie, I'm not handling the fbSession code properly, but it's coming back with None, which seems weird to me. On Sep 15, 2:02 pm, TylerWeir tyler.w...@gmail.com wrote: I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the LiftFacebookpackage? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebookclient, etc. Thanks, -Keith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: FacebookRestApi examples?
Hi Keith, You're missing a step in the process. The auth_token needs to be authenticated with facebook before you request a session. You would do this by visiting a url like http://www.facebook.com/login.php?api_key=KEYauth_token=TOKEN in a web browser. I am using the FB API in a connect application, but have forked to speak json and added a few extra calls. - Jon On Sep 15, 8:02 pm, Keith K quasike...@gmail.com wrote: I don't see any thing obviously wrong in the facebook package's method def genSignature(allParams: List[(String, Any)], secret: String). Wish I did! -Keith On Sep 15, 3:34 pm, Keith K quasike...@gmail.com wrote: Hello, I am able to get a certain distance, to the point where FB gives me back an authToken. Here is my code. println(FacebookRestApi.apiKey = + FacebookRestApi.apiKey); val respNode: Node = FacebookClient !? (AuthCreateToken); val authToken = respNode.text; println(authToken = + authToken); val fbSession: Option[FacebookSession] = FacebookSession.fromAuthToken(authToken) println(fbSession = + fbSession.toString); This doesn't include the code for the apiKey and secret. I see the following output: FacebookRestApi.apiKey = 25548077c8db93252a947a525d93be02 authToken = cd86be265bfcacf96a2dc392ffed874c fbSession = None Maybe as a scala newbie, I'm not handling the fbSession code properly, but it's coming back with None, which seems weird to me. On Sep 15, 2:02 pm, TylerWeir tyler.w...@gmail.com wrote: I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the Lift Facebook package? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebook client, etc. Thanks, -Keith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: FacebookRestApi examples?
I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the Lift Facebook package? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebook client, etc. Thanks, -Keith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: FacebookRestApi examples?
Hello, I am able to get a certain distance, to the point where FB gives me back an authToken. Here is my code. println(FacebookRestApi.apiKey = + FacebookRestApi.apiKey); val respNode: Node = FacebookClient !? (AuthCreateToken); val authToken = respNode.text; println(authToken = + authToken); val fbSession: Option[FacebookSession] = FacebookSession.fromAuthToken(authToken) println(fbSession = + fbSession.toString); This doesn't include the code for the apiKey and secret. I see the following output: FacebookRestApi.apiKey = 25548077c8db93252a947a525d93be02 authToken = cd86be265bfcacf96a2dc392ffed874c fbSession = None Maybe as a scala newbie, I'm not handling the fbSession code properly, but it's coming back with None, which seems weird to me. On Sep 15, 2:02 pm, TylerWeir tyler.w...@gmail.com wrote: I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the Lift Facebook package? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebook client, etc. Thanks, -Keith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: FacebookRestApi examples?
I don't see any thing obviously wrong in the facebook package's method def genSignature(allParams: List[(String, Any)], secret: String). Wish I did! -Keith On Sep 15, 3:34 pm, Keith K quasike...@gmail.com wrote: Hello, I am able to get a certain distance, to the point where FB gives me back an authToken. Here is my code. println(FacebookRestApi.apiKey = + FacebookRestApi.apiKey); val respNode: Node = FacebookClient !? (AuthCreateToken); val authToken = respNode.text; println(authToken = + authToken); val fbSession: Option[FacebookSession] = FacebookSession.fromAuthToken(authToken) println(fbSession = + fbSession.toString); This doesn't include the code for the apiKey and secret. I see the following output: FacebookRestApi.apiKey = 25548077c8db93252a947a525d93be02 authToken = cd86be265bfcacf96a2dc392ffed874c fbSession = None Maybe as a scala newbie, I'm not handling the fbSession code properly, but it's coming back with None, which seems weird to me. On Sep 15, 2:02 pm, TylerWeir tyler.w...@gmail.com wrote: I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the Lift Facebook package? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebook client, etc. Thanks, -Keith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---