[Lift] Re: Facebook Application

2010-02-20 Thread jon
FYI, this is now in master.

The client defaults to XML (Node), but if you want to use JSON you can
create a client like this:

 def jsonClient(session:FacebookSession) = new FacebookClient[JValue]
(session, is => {
   JsonParser.parse(new BufferedReader(new InputStreamReader(is)))
 }, FacebookFormat.json)

for (client <- FacebookConnect.session.map(jsonClient)){
  val jsonUser = client !? GetUser
}

On Feb 10, 2:08 pm, Jonathan Hoffman  wrote:
> With connect you can also get a client:
>
> for (client <- FacebookConnect.client){
>         client !? ...
>
> }
>
> On Feb 9, 2010, at 8:56 AM, Leo Lännenmäki wrote:
>
>
>
> > Hi,
>
> > I'll definitely take a look. But I think FB connect is not applicable
> > for our use..
>
> > Here a simple version of the use:
> > - We have a Lift application providing a RESTfull JSON API for our
> > clients. Through that API a client application can share a photo to
> >Facebook
> > - We have a Web client for the API provided by the Lift server looming
> > on a different machine. That client does the FB login in order to get
> > a token for the user.
> > - That token is sent to the Lift server which uses it to create a new
> > client (val client = FacebookClient.fromAuthToken(authToken).get)
> > - When the user shares a photo through our API that fb client is used
> > to upload the photo toFacebook
>
> > On Feb 9, 6:06 am, Jonathan Hoffman  wrote:
> >> Hi All,
>
> >> I just created issue #336 to provide aFacebookConnect helper and example 
> >> application.  You can take a look at what I've got 
> >> here:http://github.com/dpp/liftweb/commit/3b6686201e3b7f22100e52a04734fd4c...
>
> >> Leo, if you're trying to use fb connect, hopefully this will help you out 
> >> (I would suggest using connect rather than redirecting to FB)
>
> >> Will push out to master pending your comments and RB.
>
> >> - Jon
>
> >> On Feb 5, 2010, at 10:35 AM, Leo Lännenmäki wrote:
>
> >>> Hi,
>
> >>> I have only tried to do a couple of things with theFacebookmodule
> >>> (I'm using 2.0-M1) and I have gotten some of the stuff to actually
> >>> work :)
>
> >>> Photo upload would be something like this:
>
> >>> import java.io.File
> >>> import org.apache.commons.io.FileUtils
> >>> import net.liftweb.ext_api.facebook._
> >>> import scala.xml._
>
> >>> FacebookRestApi.apiKey = "your api key"
> >>> FacebookRestApi.secret = "secret"
>
> >>> // Get a user to login toFacebookwith a link like
> >>>http://www.facebook.com/login.php?v=1.0&api_key="your api key"
> >>> // If you mess around with theFacebooksettings you will get FB to
> >>> // redirect the user back to your app with a token as a query param
>
> >>> val authToken = "as described previously"
> >>> val client = FacebookClient.fromAuthToken(authToken).get
> >>> val photo = new File(...)
> >>> val bytes = FileUtils.readFileToByteArray(photo)
> >>> val resp = client !? UploadPhoto("test.jpg", "jpg", bytes)
> >>> val photoUrl = (resp \\ "link").text
>
> >>> Getting a list of friends:
> >>> val resp = client !? GetFriends()
>
> >>> Some real documentation and examples sure would be nice!
>
> >>> Leo
>
> >>> On Feb 3, 9:00 am, celestocalculus 
> >>> wrote:
>  Hello,
>  I'm an intermediate lift developer. Suddenly, it has become my first
>  choice framework for web applications. I really think it's a nice
>  framework you guys are doing a great job.
>  I'm new onfacebookapplication development and I have been looking at
>  the liftwebfacebookAPI. I really don't know how to put this but I'm
>  just blank, I don't know where to start. I would really appreciate it
>  if I get a step by step explanation. All the book I got onfacebook
>  apps are on php and I find it difficult to match the php codes to
>  their corresponding lift counterparts.
>
>  Please I'll also appreciate sample codes, please let it be step by
>  step and on point.
>
>  Thanks in advance.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups 
> >>> "Lift" group.
> >>> To post to this group, send email to lift...@googlegroups.com.
> >>> To unsubscribe from this group, send email to 
> >>> liftweb+unsubscr...@googlegroups.com.
> >>> For more options, visit this group 
> >>> athttp://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.



Re: [Lift] Re: Facebook Application

2010-02-10 Thread Jonathan Hoffman
With connect you can also get a client:

for (client <- FacebookConnect.client){
client !? ...
}


On Feb 9, 2010, at 8:56 AM, Leo Lännenmäki wrote:

> Hi,
> 
> I'll definitely take a look. But I think FB connect is not applicable
> for our use..
> 
> Here a simple version of the use:
> - We have a Lift application providing a RESTfull JSON API for our
> clients. Through that API a client application can share a photo to
> Facebook
> - We have a Web client for the API provided by the Lift server looming
> on a different machine. That client does the FB login in order to get
> a token for the user.
> - That token is sent to the Lift server which uses it to create a new
> client (val client = FacebookClient.fromAuthToken(authToken).get)
> - When the user shares a photo through our API that fb client is used
> to upload the photo to Facebook
> 
> 
> On Feb 9, 6:06 am, Jonathan Hoffman  wrote:
>> Hi All,
>> 
>> I just created issue #336 to provide a Facebook Connect helper and example 
>> application.  You can take a look at what I've got 
>> here:http://github.com/dpp/liftweb/commit/3b6686201e3b7f22100e52a04734fd4c...
>> 
>> Leo, if you're trying to use fb connect, hopefully this will help you out (I 
>> would suggest using connect rather than redirecting to FB)
>> 
>> Will push out to master pending your comments and RB.
>> 
>> - Jon
>> 
>> On Feb 5, 2010, at 10:35 AM, Leo Lännenmäki wrote:
>> 
>>> Hi,
>> 
>>> I have only tried to do a couple of things with the Facebook module
>>> (I'm using 2.0-M1) and I have gotten some of the stuff to actually
>>> work :)
>> 
>>> Photo upload would be something like this:
>> 
>>> import java.io.File
>>> import org.apache.commons.io.FileUtils
>>> import net.liftweb.ext_api.facebook._
>>> import scala.xml._
>> 
>>> FacebookRestApi.apiKey = "your api key"
>>> FacebookRestApi.secret = "secret"
>> 
>>> // Get a user to login to Facebook with a link like
>>> http://www.facebook.com/login.php?v=1.0&api_key="your api key"
>>> // If you mess around with the Facebook settings you will get FB to
>>> // redirect the user back to your app with a token as a query param
>> 
>>> val authToken = "as described previously"
>>> val client = FacebookClient.fromAuthToken(authToken).get
>>> val photo = new File(...)
>>> val bytes = FileUtils.readFileToByteArray(photo)
>>> val resp = client !? UploadPhoto("test.jpg", "jpg", bytes)
>>> val photoUrl = (resp \\ "link").text
>> 
>>> Getting a list of friends:
>>> val resp = client !? GetFriends()
>> 
>>> Some real documentation and examples sure would be nice!
>> 
>>> Leo
>> 
>>> On Feb 3, 9:00 am, celestocalculus 
>>> wrote:
 Hello,
 I'm an intermediate lift developer. Suddenly, it has become my first
 choice framework for web applications. I really think it's a nice
 framework you guys are doing a great job.
 I'm new on facebook application development and I have been looking at
 the liftweb facebook API. I really don't know how to put this but I'm
 just blank, I don't know where to start. I would really appreciate it
 if I get a step by step explanation. All the book I got on facebook
 apps are on php and I find it difficult to match the php codes to
 their corresponding lift counterparts.
>> 
 Please I'll also appreciate sample codes, please let it be step by
 step and on point.
>> 
 Thanks in advance.
>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/liftweb?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Facebook Application

2010-02-09 Thread Leo Lännenmäki
Hi,

I'll definitely take a look. But I think FB connect is not applicable
for our use..

Here a simple version of the use:
- We have a Lift application providing a RESTfull JSON API for our
clients. Through that API a client application can share a photo to
Facebook
- We have a Web client for the API provided by the Lift server looming
on a different machine. That client does the FB login in order to get
a token for the user.
- That token is sent to the Lift server which uses it to create a new
client (val client = FacebookClient.fromAuthToken(authToken).get)
- When the user shares a photo through our API that fb client is used
to upload the photo to Facebook


On Feb 9, 6:06 am, Jonathan Hoffman  wrote:
> Hi All,
>
> I just created issue #336 to provide a Facebook Connect helper and example 
> application.  You can take a look at what I've got 
> here:http://github.com/dpp/liftweb/commit/3b6686201e3b7f22100e52a04734fd4c...
>
> Leo, if you're trying to use fb connect, hopefully this will help you out (I 
> would suggest using connect rather than redirecting to FB)
>
> Will push out to master pending your comments and RB.
>
> - Jon
>
> On Feb 5, 2010, at 10:35 AM, Leo Lännenmäki wrote:
>
> > Hi,
>
> > I have only tried to do a couple of things with the Facebook module
> > (I'm using 2.0-M1) and I have gotten some of the stuff to actually
> > work :)
>
> > Photo upload would be something like this:
>
> > import java.io.File
> > import org.apache.commons.io.FileUtils
> > import net.liftweb.ext_api.facebook._
> > import scala.xml._
>
> > FacebookRestApi.apiKey = "your api key"
> > FacebookRestApi.secret = "secret"
>
> > // Get a user to login to Facebook with a link like
> >http://www.facebook.com/login.php?v=1.0&api_key="your api key"
> > // If you mess around with the Facebook settings you will get FB to
> > // redirect the user back to your app with a token as a query param
>
> > val authToken = "as described previously"
> > val client = FacebookClient.fromAuthToken(authToken).get
> > val photo = new File(...)
> > val bytes = FileUtils.readFileToByteArray(photo)
> > val resp = client !? UploadPhoto("test.jpg", "jpg", bytes)
> > val photoUrl = (resp \\ "link").text
>
> > Getting a list of friends:
> > val resp = client !? GetFriends()
>
> > Some real documentation and examples sure would be nice!
>
> > Leo
>
> > On Feb 3, 9:00 am, celestocalculus 
> > wrote:
> >> Hello,
> >> I'm an intermediate lift developer. Suddenly, it has become my first
> >> choice framework for web applications. I really think it's a nice
> >> framework you guys are doing a great job.
> >> I'm new on facebook application development and I have been looking at
> >> the liftweb facebook API. I really don't know how to put this but I'm
> >> just blank, I don't know where to start. I would really appreciate it
> >> if I get a step by step explanation. All the book I got on facebook
> >> apps are on php and I find it difficult to match the php codes to
> >> their corresponding lift counterparts.
>
> >> Please I'll also appreciate sample codes, please let it be step by
> >> step and on point.
>
> >> Thanks in advance.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.



Re: [Lift] Re: Facebook Application

2010-02-08 Thread Jonathan Hoffman
Hi All,

I just created issue #336 to provide a Facebook Connect helper and example 
application.  You can take a look at what I've got here: 
http://github.com/dpp/liftweb/commit/3b6686201e3b7f22100e52a04734fd4ccf67910b

Leo, if you're trying to use fb connect, hopefully this will help you out (I 
would suggest using connect rather than redirecting to FB)

Will push out to master pending your comments and RB.

- Jon

On Feb 5, 2010, at 10:35 AM, Leo Lännenmäki wrote:

> Hi,
> 
> I have only tried to do a couple of things with the Facebook module
> (I'm using 2.0-M1) and I have gotten some of the stuff to actually
> work :)
> 
> Photo upload would be something like this:
> 
> import java.io.File
> import org.apache.commons.io.FileUtils
> import net.liftweb.ext_api.facebook._
> import scala.xml._
> 
> FacebookRestApi.apiKey = "your api key"
> FacebookRestApi.secret = "secret"
> 
> // Get a user to login to Facebook with a link like
> http://www.facebook.com/login.php?v=1.0&api_key="your api key"
> // If you mess around with the Facebook settings you will get FB to
> // redirect the user back to your app with a token as a query param
> 
> val authToken = "as described previously"
> val client = FacebookClient.fromAuthToken(authToken).get
> val photo = new File(...)
> val bytes = FileUtils.readFileToByteArray(photo)
> val resp = client !? UploadPhoto("test.jpg", "jpg", bytes)
> val photoUrl = (resp \\ "link").text
> 
> Getting a list of friends:
> val resp = client !? GetFriends()
> 
> Some real documentation and examples sure would be nice!
> 
> Leo
> 
> On Feb 3, 9:00 am, celestocalculus 
> wrote:
>> Hello,
>> I'm an intermediate lift developer. Suddenly, it has become my first
>> choice framework for web applications. I really think it's a nice
>> framework you guys are doing a great job.
>> I'm new on facebook application development and I have been looking at
>> the liftweb facebook API. I really don't know how to put this but I'm
>> just blank, I don't know where to start. I would really appreciate it
>> if I get a step by step explanation. All the book I got on facebook
>> apps are on php and I find it difficult to match the php codes to
>> their corresponding lift counterparts.
>> 
>> Please I'll also appreciate sample codes, please let it be step by
>> step and on point.
>> 
>> Thanks in advance.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Facebook Application

2010-02-05 Thread Leo Lännenmäki
Hi,

I have only tried to do a couple of things with the Facebook module
(I'm using 2.0-M1) and I have gotten some of the stuff to actually
work :)

Photo upload would be something like this:

import java.io.File
import org.apache.commons.io.FileUtils
import net.liftweb.ext_api.facebook._
import scala.xml._

FacebookRestApi.apiKey = "your api key"
FacebookRestApi.secret = "secret"

// Get a user to login to Facebook with a link like
http://www.facebook.com/login.php?v=1.0&api_key="your api key"
// If you mess around with the Facebook settings you will get FB to
// redirect the user back to your app with a token as a query param

val authToken = "as described previously"
val client = FacebookClient.fromAuthToken(authToken).get
val photo = new File(...)
val bytes = FileUtils.readFileToByteArray(photo)
val resp = client !? UploadPhoto("test.jpg", "jpg", bytes)
val photoUrl = (resp \\ "link").text

Getting a list of friends:
val resp = client !? GetFriends()

Some real documentation and examples sure would be nice!

Leo

On Feb 3, 9:00 am, celestocalculus 
wrote:
> Hello,
> I'm an intermediate lift developer. Suddenly, it has become my first
> choice framework for web applications. I really think it's a nice
> framework you guys are doing a great job.
> I'm new on facebook application development and I have been looking at
> the liftweb facebook API. I really don't know how to put this but I'm
> just blank, I don't know where to start. I would really appreciate it
> if I get a step by step explanation. All the book I got on facebook
> apps are on php and I find it difficult to match the php codes to
> their corresponding lift counterparts.
>
> Please I'll also appreciate sample codes, please let it be step by
> step and on point.
>
> Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Facebook Application

2010-02-05 Thread Mads Hartmann
Hello,
I've been in Emacs land the past couple of days, tried it out, got
lost but i've found my way back to TextMate ;)

I would like to take a wack at this, but it's hard for me to estimate
how much time I have to play around lift the next two weeks though -
so if it isn't something that needs to get fixed right away I would
like to work on it :)

Thanks,
Mads Hartmann Jensen

On Feb 4, 10:22 am, Timothy Perrett  wrote:
> Seems like this would be a good task to assign to one of the new / free of 
> task committers? It probably wouldn't take a huge amount of work to clean it 
> up right? Ideally we want to avoid having modules in Lift that are totally 
> unsupported :-)
>
> Cheers, Tim
>
> On 3 Feb 2010, at 22:52, David Pollak wrote:
>
>
>
> > The current LiftFacebooksupport is old and growing cobwebs.  Jorge Ortiz, 
> > the guy who wrote most of the code, might have some additional thoughts.
>
> > My suggestion is looking for a Java-based FB library and using that within 
> > your Liftapp.
>
> > Sorry.
>
> > David

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Facebook Application

2010-02-04 Thread celestocalculus
Thanks David and Timothy. I'll just Java the facebook application. ;-)

On Feb 4, 10:22 am, Timothy Perrett  wrote:
> Seems like this would be a good task to assign to one of the new / free of 
> task committers? It probably wouldn't take a huge amount of work to clean it 
> up right? Ideally we want to avoid having modules in Lift that are totally 
> unsupported :-)
>
> Cheers, Tim
>
> On 3 Feb 2010, at 22:52, David Pollak wrote:
>
>
>
> > The current Lift Facebook support is old and growing cobwebs.  Jorge Ortiz, 
> > the guy who wrote most of the code, might have some additional thoughts.
>
> > My suggestion is looking for a Java-based FB library and using that within 
> > your Lift app.
>
> > Sorry.
>
> > David

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.