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, |