Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fb Friend selector in google app engine

<fb:serverFbml style="width: 240px;">
                        <form method="post" action="/friend-selector" id="friend-selector">

                                <script type="text/fbml">
                            <fb:fbml>
                                <fb:friend-selector uid="xxxxx" name="uid" idname="friendselector_s"/>
                            </fb:fbml>
                            </script>
                            <INPUT type="submit" value="submit" class="submit" />
                        </form>
                    </fb:serverFbml>

At backend i am trying to get the friends id:

def post(self):
  logging.info(self.request.POST)
  ss=self.request.POST[u'friendselector_s']
  logging.info(ss)`

So I am geeting error.

Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 702, in __call__
    handler.post(*groups)
  File "D:\Workspace\main.py", line 142, in post
    ss=self.request.POST[u'friendselector_s']
  File "C:\Program Files\Google\google_appengine\lib\webob\webob\multidict.py", line 302, in __getitem__
    return self._decode_value(self.multi.__getitem__(key))
  File "C:\Program Files\Google\google_appengine\lib\webob\webob\multidict.py", line 77, in __getitem__
    raise KeyError(key)

I am using this code in facebook with google app egine at backend. When collect the data at backend i didnt get the idname. On whole i am not getting selected freind id. I also need the data in javscript side also.

like image 886
goblin2986 Avatar asked Sep 12 '11 17:09

goblin2986


1 Answers

You should be using the new App Request JavaScript function to send requests, instead of the depreciated FBML version. You can do a simple request using:

FB.ui({method: 'apprequests',
    message: 'My Great Request',
}, requestCallback);

The Facebook Requests Documentation can help you out further.

like image 165
Niraj Shah Avatar answered Oct 14 '22 13:10

Niraj Shah