--- koha-facebook.cgi 2009/06/26 21:14:01 3 +++ koha-facebook.cgi 2009/06/27 16:44:51 4 @@ -108,19 +108,24 @@ form($q); -=for later - # You could do this easier by using , just showing some API stuff here. +# http://wiki.developers.facebook.com/index.php/User_(FQL) my $name = "You"; - if ($params) { - my $res = - $facebook->fql->query( query => - "SELECT first_name FROM user WHERE uid=$params->{canvas_user}" ); - $name = "Hi $res->[0]->{first_name}, you"; + if ( my $uid = $params->{user} ) { + my $res = $facebook->fql->query( query => qq| + select + first_name, last_name, + is_app_user, + books, + locale + from user + where uid=$uid + | ); + warn "# $uid res = ",dump(@{$res}); + $name = "Hello $res->[0]->{first_name}, you"; } print "$name ", ( $params ? "have" : "have't" ), - " added this application. Some info."; -=cut + " added this application."; if ( !$params ) { print "