/[koha-facebook]/koha-facebook.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /koha-facebook.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3 by dpavlin, Fri Jun 26 21:14:01 2009 UTC revision 4 by dpavlin, Sat Jun 27 16:44:51 2009 UTC
# Line 108  warn dump($params); Line 108  warn dump($params);
108    
109          form($q);          form($q);
110    
 =for later  
   
111  # You could do this easier by using <fb:name>, just showing some API stuff here.  # You could do this easier by using <fb:name>, just showing some API stuff here.
112    # http://wiki.developers.facebook.com/index.php/User_(FQL)
113      my $name = "You";      my $name = "You";
114      if ($params) {      if ( my $uid = $params->{user} ) {
115          my $res =          my $res = $facebook->fql->query( query => qq|
116              $facebook->fql->query( query =>                  select
117                  "SELECT first_name FROM user WHERE uid=$params->{canvas_user}" );                          first_name, last_name,
118          $name = "Hi $res->[0]->{first_name}, you";                          is_app_user,
119                            books,
120                            locale
121                    from user
122                    where uid=$uid
123            | );
124            warn "# $uid res = ",dump(@{$res});
125            $name = "Hello $res->[0]->{first_name}, you";
126      }      }
127      print "$name ", ( $params ? "have" : "have't" ),      print "$name ", ( $params ? "have" : "have't" ),
128          " added this application. Some <a href='info'>info</a>.";          " added this application.";
 =cut  
129    
130      if ( !$params ) {      if ( !$params ) {
131          print "<a href='", $facebook->get_add_url,          print "<a href='", $facebook->get_add_url,

Legend:
Removed from v.3  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26